Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp157549imm; Wed, 30 May 2018 20:24:11 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJdWiSDVwPnfqAPjttq/yzPaEgPiIhoYvRML/Drg3eTw5slENfZX4Ayjob0w2GZaYiUtLTZ X-Received: by 2002:a17:902:8f84:: with SMTP id z4-v6mr5372926plo.194.1527737051162; Wed, 30 May 2018 20:24:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527737051; cv=none; d=google.com; s=arc-20160816; b=TGgG3bExB0aqyEc/17E4tylI9vv4qG2AXmK2P0/o9UGtIcp3IGdq3ipXYNMUFm9HjO LoSYbyhDFOrB6EKq2H2Qzl4tn4c4NA4Zq/Q2M+or0oGbSJD+wiskpa44DsgB0prGmaCJ U8ckN3epl+0V98ytu09FHwyI3GTxOFqZSFIxOo9j8GkPbUYvAN+nkeGR89oW8CqhwRab dcUvT+KKtbFlo32rQ31JS/jAL61AZYMh4+3UdCIfL8Yvr+hXR8KmtZDuvNu05DpWYltr zi+g26ELm41nrugh28Z6mjjgw9Ii3j5w7OEpnCpST7cv/K7o/eDuFRqeOJ1Xq+IPP7r7 Y/fg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:message-id :subject:cc:to:from:date:dkim-signature:arc-authentication-results; bh=EUcpT9vBlWoulPFeSo3sUzPFU6PlNRRCcae30XF1OYk=; b=dinI2h1k+EyMm4CLQCltggEiU5Sc7PnAfcFHZP39fwKHjsAG9UQ8DYSOxu3NDbHEAe 84GlS+7+9S/f07yjlc2TIIuQ427Lw/3eWb4C/I8vmDn9MJ/9oFeUBhOJN4f4VxcW2ZbI z8G4HIMO/eMQjiKCHWIVso09ZOZO6RnRl61hLBzxslOQokWO0VLBlwB92AsATOT+fhga c9UiJnjaIVdzJPK860+Rq7YaWnuat5s+xS//OpIvNN5JZZONl1ATllVjGDaPm614g7xt YP/NsWysbQb8D+Qm6/XrMaZaaNPjgkl8Xy0b17T0m9S79jBOj/7fNmXn7m6w8finhIQz 81Rw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=MhtM9f1Y; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m4-v6si35406951plt.561.2018.05.30.20.23.56; Wed, 30 May 2018 20:24:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=MhtM9f1Y; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932706AbeEaDX1 (ORCPT + 99 others); Wed, 30 May 2018 23:23:27 -0400 Received: from mail-pg0-f67.google.com ([74.125.83.67]:37629 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932637AbeEaDX0 (ORCPT ); Wed, 30 May 2018 23:23:26 -0400 Received: by mail-pg0-f67.google.com with SMTP id a13-v6so9046062pgu.4 for ; Wed, 30 May 2018 20:23:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:user-agent:mime-version; bh=EUcpT9vBlWoulPFeSo3sUzPFU6PlNRRCcae30XF1OYk=; b=MhtM9f1YBs5dlmZrwMYAaYg864gB7egeGanfuXQKhtmqaVbqsHpSV1hC7tFI51VfcE W8cJzAmxiI8l37xHjj+bMmmzMR8EiBzlf6lzQ0HPulKrSr6UV12znEvP1747fpB14av0 FTnkZ8/y3+4JD4BM4joI+bSKskNeqCPExFAqX1Ot+I8iOSqKU+eDPqoBCDB381NhO+7M 8iRUt8PcXXJPbXQ9IP5MhwWa3okaQ3FXeLGhjHh3W7Dbl1NESa4zJVDDfBFNMfH5olHG VhGj94xyuFavkYkOebYmnqLctcPkZMfV8Eec1jtiZs7MxBlmtzfZvgzwyh1D9D1zsNNf ItOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:user-agent :mime-version; bh=EUcpT9vBlWoulPFeSo3sUzPFU6PlNRRCcae30XF1OYk=; b=DEOvic5FbClXI7VzEKrWEFCao1DolcqIQAHNf25ymLOqzIiOogtKzv9d4CMT43z4F2 ZduqXwSs5fQvU71e5twdfwpN6VAJbt6mABTD78wAoL3FC+PoN03tpENghiAP0zWY/6MX jQcEPkclUpar9DiW+tUshN8tfnemR2v0earOneZT52iEtuWX+5EcrGgDVW+WArBkgkma WBLrEWTOKj22tc+DRTBYEtfYnk1kZAa0BWJmxZ+QamwwrUy9Z1hEmnzcEvw4HPwikk7K sIbEePIp77xLPeJ9V+qwIufeW5+VDOUb5+R279c9SLPYNh/bcESYgooWbbBgS909flTg aWOg== X-Gm-Message-State: ALKqPweXRa4XHtHOMGcVB0e/M06iLpPRbO+ppEayKDbMXE2bUgBeMkNO RGaUOPZ9nfYbkYf/BM7HjGh/oQ== X-Received: by 2002:a62:249b:: with SMTP id k27-v6mr5194823pfk.143.1527737005628; Wed, 30 May 2018 20:23:25 -0700 (PDT) Received: from [100.112.72.59] ([104.133.9.107]) by smtp.gmail.com with ESMTPSA id 185-v6sm66513857pfu.13.2018.05.30.20.23.24 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 30 May 2018 20:23:24 -0700 (PDT) Date: Wed, 30 May 2018 20:23:16 -0700 (PDT) From: Hugh Dickins X-X-Sender: hugh@eggly.anvils To: Andrew Morton cc: Mel Gorman , Minchan Kim , "Huang, Ying" , Jan Kara , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH] mm: fix the NULL mapping case in __isolate_lru_page() Message-ID: User-Agent: Alpine 2.11 (LSU 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org George Boole would have noticed a slight error in 4.16 commit 69d763fc6d3a ("mm: pin address_space before dereferencing it while isolating an LRU page"). Fix it, to match both the comment above it, and the original behaviour. Although anonymous pages are not marked PageDirty at first, we have an old habit of calling SetPageDirty when a page is removed from swap cache: so there's a category of ex-swap pages that are easily migratable, but were inadvertently excluded from compaction's async migration in 4.16. Fixes: 69d763fc6d3a ("mm: pin address_space before dereferencing it while isolating an LRU page") Signed-off-by: Hugh Dickins --- mm/vmscan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- 4.17-rc7/mm/vmscan.c 2018-04-26 10:48:36.027288294 -0700 +++ linux/mm/vmscan.c 2018-05-30 20:08:39.184634029 -0700 @@ -1418,7 +1418,7 @@ int __isolate_lru_page(struct page *page return ret; mapping = page_mapping(page); - migrate_dirty = mapping && mapping->a_ops->migratepage; + migrate_dirty = !mapping || mapping->a_ops->migratepage; unlock_page(page); if (!migrate_dirty) return ret;