Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1370583

Re: mm: BUG in khugepaged_scan_mm_slot

Path csiph.com!goblin3!goblin1!goblin.stu.neva.ru!nntpspool.opticnetworks.net!nntpspool01.opticnetworks.net!aioe.org!gothmog.csi.it!bofh.it!news.nic.it!robomod
From Vlastimil Babka <vbabka@suse.cz>
Newsgroups linux.kernel
Subject Re: mm: BUG in khugepaged_scan_mm_slot
Date Mon, 04 Apr 2016 14:10:03 +0200
Message-ID <rkbur-2OO-27@gated-at.bofh.it> (permalink)
References <rjqlP-1LG-5@gated-at.bofh.it>
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.0
MIME-Version 1.0
Content-Type text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding 7bit
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 38
Organization linux.* mail to news gateway
X-Original-Cc syzkaller <syzkaller@googlegroups.com>, Kostya Serebryany <kcc@google.com>, Alexander Potapenko <glider@google.com>, Sasha Levin <sasha.levin@oracle.com>, Andrea Arcangeli <aarcange@redhat.com>
X-Original-Date Mon, 4 Apr 2016 14:03:54 +0200
X-Original-Message-ID <5702582A.1030904@suse.cz>
X-Original-References <CACT4Y+ZmuZMV5CjSFOeXviwQdABAgT7T+StKfTqan9YDtgEi5g@mail.gmail.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1370583

Show key headers only | View raw


[+CC Andrea]

On 04/02/2016 11:48 AM, Dmitry Vyukov wrote:
> Hello,
>
> The following program triggers a BUG in khugepaged_scan_mm_slot:
>
>
> vma ffff880032698f90 start 0000000020c57000 end 0000000020c58000
> next ffff88003269a1b8 prev ffff88003269ac18 mm ffff88005e274780
> prot 35 anon_vma ffff88003182c000 vm_ops           (null)
> pgoff fed00 file ffff8800324552c0 private_data           (null)
> flags: 0x5144477(read|write|exec|mayread|maywrite|mayexec|pfnmap|io|dontexpand|account)
> ------------[ cut here ]------------
> kernel BUG at mm/huge_memory.c:2313!
> invalid opcode: 0000 [#1] SMP DEBUG_PAGEALLOC KASAN

That's VM_BUG_ON_VMA(vma->vm_flags & VM_NO_THP, vma) in 
hugepage_vma_check().

#define VM_NO_THP (VM_SPECIAL | VM_HUGETLB | VM_SHARED | VM_MAYSHARE)

#define VM_SPECIAL (VM_IO | VM_DONTEXPAND | VM_PFNMAP | VM_MIXEDMAP)

Of those, we have VM_IO | VM_DONTEXPAND.

I don't know if it's valid for a vma with anon_vma to have such flags, 
if yes, we should probably modify hugepage_vma_check(). Called from 
khugepaged_scan_mm_slot() it should just return false out VM_NO_THP. 
Called from collapse_huge_page() it could keep the VM_BUG_ON. Or maybe 
just have VM_BUG_ON(!hugepage_vma_check()) there? Hmm actually no, 
there's a mmap_sem release for read and then acquire for write, so we 
can't rely on the check done earlier from khugepaged_scan_mm_slot().

So we should probably just change the VM_BUG_ON to another "return 
false" condition. Unless the VM_BUG_ON uncovered a real bug and the 
earlier conditions in hugepage_vma_check() should guarantee the 
VM_BUG_ON be false for any vma.

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

Re: mm: BUG in khugepaged_scan_mm_slot Vlastimil Babka <vbabka@suse.cz> - 2016-04-04 14:10 +0200

csiph-web