From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f43.google.com (mail-wm0-f43.google.com [74.125.82.43]) by kanga.kvack.org (Postfix) with ESMTP id 7F1686B0009 for ; Thu, 28 Jan 2016 06:40:45 -0500 (EST) Received: by mail-wm0-f43.google.com with SMTP id l66so6903985wml.0 for ; Thu, 28 Jan 2016 03:40:45 -0800 (PST) Received: from mail-wm0-x22f.google.com (mail-wm0-x22f.google.com. [2a00:1450:400c:c09::22f]) by mx.google.com with ESMTPS id t8si3682997wmd.71.2016.01.28.03.40.44 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Jan 2016 03:40:44 -0800 (PST) Received: by mail-wm0-x22f.google.com with SMTP id l66so21454552wml.0 for ; Thu, 28 Jan 2016 03:40:44 -0800 (PST) Date: Thu, 28 Jan 2016 13:40:42 +0200 From: "Kirill A. Shutemov" Subject: Re: mm: another VM_BUG_ON_PAGE(PageTail(page)) Message-ID: <20160128114042.GE2396@node.shutemov.name> References: <20160128105136.GD2396@node.shutemov.name> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: owner-linux-mm@kvack.org List-ID: To: Dmitry Vyukov Cc: Vlastimil Babka , Doug Gilbert , Andrew Morton , David Rientjes , Naoya Horiguchi , "Kirill A. Shutemov" , Shiraz Hashim , "linux-mm@kvack.org" , LKML , Hugh Dickins , Sasha Levin , syzkaller , Kostya Serebryany , Alexander Potapenko , linux-scsi On Thu, Jan 28, 2016 at 11:55:14AM +0100, Dmitry Vyukov wrote: > On Thu, Jan 28, 2016 at 11:51 AM, Kirill A. Shutemov > wrote: > > On Thu, Jan 28, 2016 at 11:27:11AM +0100, Dmitry Vyukov wrote: > >> Hello, > >> > >> The following program triggers VM_BUG_ON_PAGE(PageTail(page)): > >> > >> // autogenerated by syzkaller (http://github.com/google/syzkaller) > >> #include > >> #include > >> #include > >> #include > >> > >> int main() > >> { > >> int fd; > >> > >> mmap((void*)0x20000000, 4096, PROT_READ|PROT_WRITE, > >> MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0); > >> fd = open("/dev/sg1", O_RDONLY|O_SYNC|0x100000); > >> mmap((void*)0x20001000, 0x4000, PROT_READ|PROT_WRITE, > >> MAP_PRIVATE|MAP_FIXED, fd, 0); > >> mbind((void*)0x20000000, 0x4000, 0x8002, (void*)0x20002ff8, 3660, > >> MPOL_MF_STRICT|MPOL_MF_MOVE); > >> return 0; > >> } > > > > I don't have sg1 in my VM. I changed it to sg0 and it doesn't trigger an > > issue: mbind() returns -EINVAL as it supposed to. Hm.. > > I've attached my config, and here is how I start qemu: > > qemu-system-x86_64 -hda wheezy.img -net > user,host=10.0.2.10,hostfwd=tcp::10022-:22 -net nic -nographic -kernel > arch/x86/boot/bzImage -append "console=ttyS0 root=/dev/sda debug > earlyprintk=serial slub_debug=UZ" -enable-kvm -pidfile vm_pid -m 2G > -numa node,nodeid=0,cpus=0-1 -numa node,nodeid=1,cpus=2-3 -smp > sockets=2,cores=2,threads=1 -usb -usbdevice mouse -usbdevice tablet > -soundhw all Still no luck. :-/ Could you try patch below. I want to see what vm_flags are. diff --git a/mm/mempolicy.c b/mm/mempolicy.c index 27d135408a22..93edf181f88a 100644 --- a/mm/mempolicy.c +++ b/mm/mempolicy.c @@ -548,8 +548,10 @@ retry: goto retry; } - if (flags & (MPOL_MF_MOVE | MPOL_MF_MOVE_ALL)) + if (flags & (MPOL_MF_MOVE | MPOL_MF_MOVE_ALL)) { + VM_BUG_ON_VMA(PageTail(page), vma); migrate_page_add(page, qp->pagelist, flags); + } } pte_unmap_unlock(pte - 1, ptl); cond_resched(); -- 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: email@kvack.org