From patchwork Fri Jan 29 12:35:11 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kirill A. Shutemov" X-Patchwork-Id: 8162951 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id AAB16BEEE5 for ; Fri, 29 Jan 2016 12:35:38 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D35AD20384 for ; Fri, 29 Jan 2016 12:35:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E285C2037E for ; Fri, 29 Jan 2016 12:35:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755828AbcA2MfT (ORCPT ); Fri, 29 Jan 2016 07:35:19 -0500 Received: from mga09.intel.com ([134.134.136.24]:10411 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754977AbcA2MfR (ORCPT ); Fri, 29 Jan 2016 07:35:17 -0500 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP; 29 Jan 2016 04:35:16 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,364,1449561600"; d="scan'208,223";a="903805288" Received: from black.fi.intel.com ([10.237.72.93]) by fmsmga002.fm.intel.com with ESMTP; 29 Jan 2016 04:35:12 -0800 Received: by black.fi.intel.com (Postfix, from userid 1000) id 4DB67B2; Fri, 29 Jan 2016 14:35:11 +0200 (EET) Date: Fri, 29 Jan 2016 15:35:11 +0300 From: "Kirill A. Shutemov" To: Dmitry Vyukov Cc: "Kirill A. Shutemov" , Vlastimil Babka , Doug Gilbert , Andrew Morton , David Rientjes , Naoya Horiguchi , Shiraz Hashim , "linux-mm@kvack.org" , LKML , Hugh Dickins , Sasha Levin , syzkaller , Kostya Serebryany , Alexander Potapenko , linux-scsi Subject: Re: mm: another VM_BUG_ON_PAGE(PageTail(page)) Message-ID: <20160129123511.GA146512@black.fi.intel.com> References: <20160128105136.GD2396@node.shutemov.name> <20160128114042.GE2396@node.shutemov.name> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23.1 (2014-03-12) Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From e20cd50a8f612dbc720d31d269e748215607a0b8 Mon Sep 17 00:00:00 2001 From: "Kirill A. Shutemov" Date: Fri, 29 Jan 2016 14:55:40 +0300 Subject: [PATCH 1/2] mm: fix bogus VM_BUG_ON_PAGE() in isolate_lru_page() We don't care if there's a tail pages which is not on LRU. We are not going to isolate them anyway. Testcase: #include #include #include #include #include #define SIZE 0x2000 int foo; int main() { int fd; char *p; unsigned long mask = 2; fd = open("/dev/sg0", O_RDWR); p = mmap(NULL, SIZE, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0); /* Faultin pages */ foo = p[0] + p[0x1000]; mbind(p, SIZE, MPOL_BIND, &mask, 4, MPOL_MF_MOVE | MPOL_MF_STRICT); return 0; } MPOL_MF_STRICT makes queue_pages_test_walk() ignore !vma_megratable() and we try to queue such pages for migration. It's good question why we ignore !vma_megratable() for MPOL_MF_STRICT, but it's subject for a separate patch. Signed-off-by: Kirill A. Shutemov Reported-by: Dmitry Vyukov Fixes: bb5b8589767a ("mm: make sure isolate_lru_page() is never called for tail page") --- mm/vmscan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/vmscan.c b/mm/vmscan.c index eb3dd37ccd7c..492fbe73420b 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -1443,7 +1443,7 @@ int isolate_lru_page(struct page *page) int ret = -EBUSY; VM_BUG_ON_PAGE(!page_count(page), page); - VM_BUG_ON_PAGE(PageTail(page), page); + VM_BUG_ON_PAGE(PageLRU(page) && PageTail(page), page); if (PageLRU(page)) { struct zone *zone = page_zone(page);