From patchwork Thu May 31 03:23:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hugh Dickins X-Patchwork-Id: 10440185 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D2946602BC for ; Thu, 31 May 2018 03:23:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B9A5B26E73 for ; Thu, 31 May 2018 03:23:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ADD5B2817F; Thu, 31 May 2018 03:23:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, USER_IN_DEF_DKIM_WL autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4304026E73 for ; Thu, 31 May 2018 03:23:29 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2C96A6B0005; Wed, 30 May 2018 23:23:28 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 24FCA6B0006; Wed, 30 May 2018 23:23:28 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0F31C6B0007; Wed, 30 May 2018 23:23:28 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pf0-f199.google.com (mail-pf0-f199.google.com [209.85.192.199]) by kanga.kvack.org (Postfix) with ESMTP id B70EF6B0005 for ; Wed, 30 May 2018 23:23:27 -0400 (EDT) Received: by mail-pf0-f199.google.com with SMTP id w7-v6so12026340pfd.9 for ; Wed, 30 May 2018 20:23:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:date:from:to:cc:subject :message-id:user-agent:mime-version; bh=EUcpT9vBlWoulPFeSo3sUzPFU6PlNRRCcae30XF1OYk=; b=Q5/fDpYcbbWlfk855aOV45rLMm08dKRQjct7LT5x6xo0EAI5KHst9A9osGONzv0wuy uuNT2LEWZ4z6j3OxOrHyvq2n5HdmjMo+jdvNgiRh26ugX3bVJOvYl5UPUMjy4B+UzsOq jMLahCcfJ3SzeIqe7kGYUKN+XVjv8xHqYGKgL/3ZphuDda1KlDO4x+OU1EjPazqtL0Hc 37GW+xfmt/Y0MuRl8zcg5ixVY/sc0fQ4Rh8OzQiKKupxHVcM5364NqRtTDYKAvIlLVXp gdO1ZEN60WZg6ggt/YemLQ2qAUdYtZd/XM6QG5axNPciuNg8ze+fUy8S+hK9xey5+kOk S/sg== X-Gm-Message-State: ALKqPwdGxb5/F0Ipwl7zFdVShNaY+SzUUtSWbc0VPGc7Xx/E/Y5e10MO wqCjHaEC9+DDFASCTft4n6HDz8JHaiBkBYlLKp/LSTE17/dqOsF1TwuS3LY6eY7Kmz5z0UZIC1d tXt+pOfkmc8VmI5YOJBMNCO6YfxaJpPmkCs1RoIXLbp6xsw3glga0mNLqqKsd6kAD96Qxm9EwID PAqS3Tw305Rak/p1gGWmBlL3hQ9MC8pEQVYP047N6xp8DxqLbhWCbSGeyozM2V3E8+JLYwcAlsb 1OLmagp/ZaOJT1y3Uy0P8rki22WAy4yn+IWhGmRbMSita5MAPvdHtifBfbwNhLn+PUl09W9p5fa t59Xu/cLpTiwimXTSIxa4QeJ9o7ancMTzo2XV7/rOQUQ5E1JnI2nARX+51+8Sg+hSbbzLlgSwoc 3 X-Received: by 2002:a17:902:8ec2:: with SMTP id x2-v6mr5262106plo.370.1527737007197; Wed, 30 May 2018 20:23:27 -0700 (PDT) X-Received: by 2002:a17:902:8ec2:: with SMTP id x2-v6mr5262075plo.370.1527737006447; Wed, 30 May 2018 20:23:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527737006; cv=none; d=google.com; s=arc-20160816; b=JAd9xuZdWm7qahqm2400Dv9uPmnRQLpzSV2COjWee99DKrtbtf13OIKyr2/TwDm+DZ bZlNAvk4OvyxCAU1tEOy7mDYYzYTqtFH9wMSG2NEQdnYqqnKhbjfM/MLAo3hMp0g2Voo ah1yj9xwBW2ohiv082QgjKwPzhZWCksuZrARGttIr8szITYtO6zlyFThqimVUY8pmQbn Rq1X/P1O4KJpPpGyGEV1gf1XwGll2Erbs4o2oQObXLlQUdx9Mfe/sbea00W9C/Z1BRaY grbAnG+D+tqh8iNJWpmn0XO35EH6f4SzNeR6WMcQyoeha0eHiG5lpO87c3CLRjn1qeZk TZZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:user-agent:message-id:subject:cc:to:from:date :dkim-signature:arc-authentication-results; bh=EUcpT9vBlWoulPFeSo3sUzPFU6PlNRRCcae30XF1OYk=; b=snEuK1bhotq/VLzUp+omttZ8sSqkwpTi2paPAAsIe0YQCuvZUru8hzHHcZ+KyMziCM nIRuKLX/+CcfArlP8W+flS7/FT1SoCMJhuFZQHb1UHCX2vbUs2KNhpON/ch5ynDBXN0O q4SEWduqMOKcv2Sb+8ShTik5TUPF6tktPNNwLoET5BixeFMbMP09VhJDxfMwDfBnj3Ic mdD09U44zEUQFQhihQnTyJ7Mjc+z45FdEq1hDwPFbkMk7u5sEG/Zh9XHkvy4iF12D2Fe XP5y+8hoaf/kt4kAAGjzvatlLnurpIir6CnSDm+OLL4q73AT70zkF72o9Q8EThgnoDK+ pxjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=MhtM9f1Y; spf=pass (google.com: domain of hughd@google.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=hughd@google.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id b29-v6sor12957856pfh.75.2018.05.30.20.23.26 for (Google Transport Security); Wed, 30 May 2018 20:23:26 -0700 (PDT) Received-SPF: pass (google.com: domain of hughd@google.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=MhtM9f1Y; spf=pass (google.com: domain of hughd@google.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=hughd@google.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com 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-Smtp-Source: ADUXVKLYRqxhFOF656fpHd/hirsrswOTDTl4mB3StiLOjxVgnHsFl0ndZNYcu2VcthuVm5mQmLD1lA== 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 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP 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 Acked-by: Minchan Kim Acked-by: Mel Gorman --- 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;