Re: mm: VM_BUG_ON_PAGE(PageTail(page)) in mbind

2016-01-26 Thread Vlastimil Babka
On 26.1.2016 21:28, Kirill A. Shutemov wrote: > From 396ad132be07a2d2b9ec5d1d6ec9fe2fffe8105e Mon Sep 17 00:00:00 2001 > From: "Kirill A. Shutemov" > Date: Tue, 26 Jan 2016 22:59:16 +0300 > Subject: [PATCH] sg: mark VMA as VM_IO to prevent migration > > Reduced testcase: > > #include >

Re: mm: VM_BUG_ON_PAGE(PageTail(page)) in mbind

2016-01-26 Thread Kirill A. Shutemov
On Tue, Jan 26, 2016 at 12:48:23PM -0800, Andrew Morton wrote: > On Tue, 26 Jan 2016 22:28:29 +0200 "Kirill A. Shutemov" > wrote: > > > The patch below fixes the issue for me, but this bug makes me wounder how > > many bugs like this we have in kernel... :-/ > > > > Looks like we are too permis

Re: mm: VM_BUG_ON_PAGE(PageTail(page)) in mbind

2016-01-26 Thread Kirill A. Shutemov
On Tue, Jan 26, 2016 at 12:49:16PM -0800, Andrew Morton wrote: > On Tue, 26 Jan 2016 22:28:29 +0200 "Kirill A. Shutemov" > wrote: > > > Let's mark the VMA as VM_IO to indicate to mm core that the VMA is > > migratable. > > > > ... > > > > --- a/drivers/scsi/sg.c > > +++ b/drivers/scsi/sg.c > >

Re: mm: VM_BUG_ON_PAGE(PageTail(page)) in mbind

2016-01-26 Thread Andrew Morton
On Tue, 26 Jan 2016 22:28:29 +0200 "Kirill A. Shutemov" wrote: > Let's mark the VMA as VM_IO to indicate to mm core that the VMA is > migratable. > > ... > > --- a/drivers/scsi/sg.c > +++ b/drivers/scsi/sg.c > @@ -1261,7 +1261,7 @@ sg_mmap(struct file *filp, struct vm_area_struct *vma) >

Re: mm: VM_BUG_ON_PAGE(PageTail(page)) in mbind

2016-01-26 Thread Andrew Morton
On Tue, 26 Jan 2016 22:28:29 +0200 "Kirill A. Shutemov" wrote: > The patch below fixes the issue for me, but this bug makes me wounder how > many bugs like this we have in kernel... :-/ > > Looks like we are too permissive about which VMA is migratable: > vma_migratable() filters out VMA by VM_

Re: mm: VM_BUG_ON_PAGE(PageTail(page)) in mbind

2016-01-26 Thread Kirill A. Shutemov
On Tue, Jan 26, 2016 at 01:52:31PM +0100, Dmitry Vyukov wrote: > Hello, > > The following program triggers the following bug: > > page:eab82240 count:0 mapcount:1 mapping:dead > index:0x0 compound_mapcount: 0 > flags: 0x1fffc00() > page dumped because: VM_BUG_ON_PAGE(P