From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751945AbcAZUs0 (ORCPT ); Tue, 26 Jan 2016 15:48:26 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:49362 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751694AbcAZUsY (ORCPT ); Tue, 26 Jan 2016 15:48:24 -0500 Date: Tue, 26 Jan 2016 12:48:23 -0800 From: Andrew Morton To: "Kirill A. Shutemov" Cc: Dmitry Vyukov , Doug Gilbert , 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@vger.kernel.org Subject: Re: mm: VM_BUG_ON_PAGE(PageTail(page)) in mbind Message-Id: <20160126124823.15b08f0a53dd9671fbc685d9@linux-foundation.org> In-Reply-To: <20160126202829.GA21250@node.shutemov.name> References: <20160126202829.GA21250@node.shutemov.name> X-Mailer: Sylpheed 3.4.1 (GTK+ 2.24.23; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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_IO and VM_PFNMAP. > I think VM_DONTEXPAND also correlate with VMA which cannot be migrated. > > $ git grep VM_DONTEXPAND drivers | grep -v '\(VM_IO\|VM_PFNMAN\)' | wc -l > 33 > > Hm.. :-| > > It worth looking on them closely... And I wouldn't be surprised if some > VMAs without all of these flags are not migratable too. > > Sigh.. Any thoughts? Sigh indeed. I think that both VM_DONTEXPAND and VM_DONTDUMP are pretty good signs that mbind() should not be mucking with this vma. If such a policy sometimes results in mbind failing to set a policy then that's not a huge loss - something runs a bit slower maybe. I mean, we only really expect mbind() to operate against regular old anon/pagecache memory, yes?