linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Kirill A. Shutemov" <kirill@shutemov.name>
To: Sasha Levin <sasha.levin@oracle.com>
Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Hugh Dickins <hughd@google.com>,
	Andrea Arcangeli <aarcange@redhat.com>,
	Dave Hansen <dave.hansen@intel.com>, Mel Gorman <mgorman@suse.de>,
	Rik van Riel <riel@redhat.com>, Vlastimil Babka <vbabka@suse.cz>,
	Christoph Lameter <cl@gentwo.org>,
	Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>,
	Steve Capper <steve.capper@linaro.org>,
	"Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Michal Hocko <mhocko@suse.cz>,
	Jerome Marchand <jmarchan@redhat.com>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [PATCH 12/16] page-flags: define PG_mlocked behavior on compound pages
Date: Wed, 18 May 2016 17:02:46 +0300	[thread overview]
Message-ID: <20160518140246.GA24901@node.shutemov.name> (raw)
In-Reply-To: <5715393B.5030901@oracle.com>

On Mon, Apr 18, 2016 at 03:44:59PM -0400, Sasha Levin wrote:
> On 09/24/2015 10:51 AM, Kirill A. Shutemov wrote:
> > Transparent huge pages can be mlocked -- whole compund page at once.
> > Something went wrong if we're trying to mlock() tail page.
> > Let's use PF_NO_TAIL.
> 
> Kirill, Hugh,
> 
> I seem to be hitting this with trinity:
> 
> [  242.257552] page:ffffea0001517fc0 count:0 mapcount:0 mapping:dead000000000400 index:0x0 compound_mapcount: 0
> [  242.258680] flags: 0x1fffff80000000()
> [  242.261853] page dumped because: VM_BUG_ON_PAGE(1 && PageTail(page))
> [  242.262712] ------------[ cut here ]------------
> [  242.263182] kernel BUG at include/linux/page-flags.h:332!
> [  242.263731] invalid opcode: 0000 [#1] PREEMPT SMP KASAN
> [  242.264246] Modules linked in:
> [  242.264603] CPU: 2 PID: 9302 Comm: trinity-c67 Not tainted 4.6.0-rc3-next-20160412-sasha-00024-geaec67e #3001
> [  242.265574] task: ffff88013270c000 ti: ffff88012d0d0000 task.ti: ffff88012d0d0000
> [  242.266306] RIP: clear_pages_mlock (include/linux/page-flags.h:332 mm/mlock.c:82)
> [  242.267325] RSP: 0018:ffff88012d0d70e0  EFLAGS: 00010286
> [  242.267894] RAX: 0000000000000000 RBX: ffffea0001517fc0 RCX: 0000000000000000
> [  242.268773] RDX: 1ffffd40002a2fff RSI: 0000000000000282 RDI: ffffea0001517ff8
> [  242.269495] RBP: ffff88012d0d7120 R08: ffffffffb66a1566 R09: fffffbfff6cd42ad
> [  242.270227] R10: ffffffffb61dc140 R11: 00000000e27286ff R12: ffffea0001517fe0
> [  242.270961] R13: ffffea0001518000 R14: dffffc0000000000 R15: 0000000000000000
> [  242.271686] FS:  00007f594abad700(0000) GS:ffff8801b5a00000(0000) knlGS:0000000000000000
> [  242.272494] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> [  242.273073] CR2: 0000000001f27000 CR3: 0000000132418000 CR4: 00000000000006a0
> [  242.273815] Stack:
> [  242.274036]  0000000000000008 ffff880083fd3000 0000000100000000 ffffea0001517fc0
> [  242.274847]  ffffea0001517fe0 ffffea0001510000 ffffea0001510001 0000000000000000
> [  242.275656]  ffff88012d0d7170 ffffffff9d712322 ffffffff9d7221ab 0000000001400000
> [  242.276458] Call Trace:
> [  242.276746] page_remove_rmap (include/linux/page-flags.h:157 include/linux/page-flags.h:522 mm/rmap.c:1383)
> [  242.277989] __split_huge_pmd_locked (include/linux/compiler.h:222 (discriminator 3) include/linux/page-flags.h:143 (discriminator 3) include/linux/mm.h:736 (discriminator 3) mm/huge_memory.c:3075 (discriminator 3))
> [  242.279909] __split_huge_pmd (include/linux/spinlock.h:347 mm/huge_memory.c:3102)
> [  242.280515] split_huge_pmd_address (mm/huge_memory.c:3137)
> [  242.281181] try_to_unmap_one (include/linux/compiler.h:222 include/linux/page-flags.h:143 include/linux/page-flags.h:268 include/linux/mm.h:495 mm/rmap.c:1425)
> [  242.285008] rmap_walk_anon (mm/rmap.c:1762)
> [  242.286167] rmap_walk_locked (mm/rmap.c:1845)
> [  242.286753] try_to_unmap (mm/rmap.c:1643)
> [  242.291004] split_huge_page_to_list (mm/huge_memory.c:3191 mm/huge_memory.c:3380)
> [  242.293499] queue_pages_pte_range (mm/mempolicy.c:505)
> [  242.294728] __walk_page_range (mm/pagewalk.c:51 mm/pagewalk.c:90 mm/pagewalk.c:116 mm/pagewalk.c:204)
> [  242.295331] walk_page_range (mm/pagewalk.c:282)
> [  242.295910] queue_pages_range (mm/mempolicy.c:667)
> [  242.299552] migrate_to_node (include/linux/compiler.h:222 include/linux/list.h:189 mm/mempolicy.c:1002)
> [  242.301994] do_migrate_pages (mm/mempolicy.c:1105)
> [  242.303811] SYSC_migrate_pages (mm/mempolicy.c:1451)
> [  242.307712] SyS_migrate_pages (mm/mempolicy.c:1369)
> [  242.308290] ? SyS_set_mempolicy (mm/mempolicy.c:1369)
> [  242.308892] do_syscall_64 (arch/x86/entry/common.c:350)
> [  242.310743] entry_SYSCALL64_slow_path (arch/x86/entry/entry_64.S:251)
> [ 242.311395] Code: 42 80 3c 30 00 74 08 4c 89 e7 e8 c7 f8 08 00 48 8b 43 20 a8 01 74 22 e8 da e2 ea ff 48 c7 c6 e0 9b 31 a7 48 89 df e8 0b 01 fe ff <0f> 0b 48 c7 c7 e0 3b 52 ab e8 5f 3b 9d 01 e8 b8 e2 ea ff 48 8b

That's very strange.

It's the same bug you've reported here:
http://lkml.kernel.org/r/571638CF.5090709@oracle.com

Looks like the page was re-mlocked() under us while we're splitting pmd.

In both cases it's last tail page of the THP, which probably some hint,
but I don't get it.

Do you still see the issue? I have never seen anything like this myself.

-- 
 Kirill A. Shutemov

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2016-05-18 14:02 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20150921153509.fef7ecdf313ef74307c43b65@linux-foundation.org>
2015-09-24 14:50 ` [PATCH 00/16] Refreshed page-flags patchset Kirill A. Shutemov
2015-09-24 14:50   ` [PATCH 01/16] page-flags: trivial cleanup for PageTrans* helpers Kirill A. Shutemov
2015-09-24 15:44     ` Christoph Lameter
2015-09-24 14:50   ` [PATCH 02/16] page-flags: move code around Kirill A. Shutemov
2015-09-24 14:50   ` [PATCH 03/16] page-flags: introduce page flags policies wrt compound pages Kirill A. Shutemov
2015-09-25 12:29     ` Konstantin Khlebnikov
2015-09-25 19:13       ` Kirill A. Shutemov
2015-09-28 10:02         ` Konstantin Khlebnikov
2015-09-28 11:03           ` Kirill A. Shutemov
2015-09-28 11:48             ` Konstantin Khlebnikov
2015-09-28 17:51               ` Kirill A. Shutemov
2015-09-24 14:50   ` [PATCH 04/16] page-flags: define PG_locked behavior on " Kirill A. Shutemov
2015-09-24 16:08     ` Christoph Lameter
2015-09-24 20:26       ` Kirill A. Shutemov
2015-09-24 14:50   ` [PATCH 05/16] page-flags: define behavior of FS/IO-related flags " Kirill A. Shutemov
2015-09-24 14:50   ` [PATCH 06/16] page-flags: define behavior of LRU-related " Kirill A. Shutemov
2015-09-24 14:50   ` [PATCH 07/16] page-flags: define behavior SL*B-related " Kirill A. Shutemov
2015-09-24 14:50   ` [PATCH 08/16] page-flags: define behavior of Xen-related " Kirill A. Shutemov
2015-09-24 14:50   ` [PATCH 09/16] page-flags: define PG_reserved behavior " Kirill A. Shutemov
2015-09-24 14:50   ` [PATCH 10/16] page-flags: define PG_swapbacked " Kirill A. Shutemov
2015-09-24 14:50   ` [PATCH 11/16] page-flags: define PG_swapcache " Kirill A. Shutemov
2015-09-24 14:51   ` [PATCH 12/16] page-flags: define PG_mlocked " Kirill A. Shutemov
2016-04-18 19:44     ` Sasha Levin
2016-05-18 14:02       ` Kirill A. Shutemov [this message]
2015-09-24 14:51   ` [PATCH 13/16] page-flags: define PG_uncached " Kirill A. Shutemov
2015-09-24 14:51   ` [PATCH 14/16] page-flags: define PG_uptodate " Kirill A. Shutemov
2015-09-24 14:51   ` [PATCH 15/16] page-flags: look at head page if the flag is encoded in page->mapping Kirill A. Shutemov
2015-09-24 14:51   ` [PATCH 16/16] mm: sanitize page->mapping for tail pages Kirill A. Shutemov
2015-09-25  2:20     ` Jerome Glisse
2015-09-24 16:13   ` [PATCH 00/16] Refreshed page-flags patchset Christoph Lameter
2015-09-24 20:25     ` Kirill A. Shutemov
2015-03-19 17:08 [PATCH 00/16] Sanitize usage of ->flags and ->mapping for tail pages Kirill A. Shutemov
2015-03-19 17:08 ` [PATCH 12/16] page-flags: define PG_mlocked behavior on compound pages Kirill A. Shutemov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160518140246.GA24901@node.shutemov.name \
    --to=kirill@shutemov.name \
    --cc=aarcange@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=aneesh.kumar@linux.vnet.ibm.com \
    --cc=cl@gentwo.org \
    --cc=dave.hansen@intel.com \
    --cc=hannes@cmpxchg.org \
    --cc=hughd@google.com \
    --cc=jmarchan@redhat.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@suse.de \
    --cc=mhocko@suse.cz \
    --cc=n-horiguchi@ah.jp.nec.com \
    --cc=riel@redhat.com \
    --cc=sasha.levin@oracle.com \
    --cc=steve.capper@linaro.org \
    --cc=vbabka@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).