All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hugh Dickins <hughd@google.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Mel Gorman <mgorman@techsingularity.net>,
	Minchan Kim <minchan@kernel.org>,
	"Huang, Ying" <ying.huang@intel.com>, Jan Kara <jack@suse.cz>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: [PATCH] mm: fix the NULL mapping case in __isolate_lru_page()
Date: Wed, 30 May 2018 20:23:16 -0700 (PDT)	[thread overview]
Message-ID: <alpine.LSU.2.11.1805302014001.12558@eggly.anvils> (raw)

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 <hughd@google.com>
---

 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;

             reply	other threads:[~2018-05-31  3:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-31  3:23 Hugh Dickins [this message]
2018-05-31  5:03 ` [PATCH] mm: fix the NULL mapping case in __isolate_lru_page() Minchan Kim
2018-05-31  7:26 ` Mel Gorman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LSU.2.11.1805302014001.12558@eggly.anvils \
    --to=hughd@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=jack@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@techsingularity.net \
    --cc=minchan@kernel.org \
    --cc=ying.huang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.