All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mm: fix the NULL mapping case in __isolate_lru_page()
@ 2018-05-31  3:23 Hugh Dickins
  2018-05-31  5:03 ` Minchan Kim
  2018-05-31  7:26 ` Mel Gorman
  0 siblings, 2 replies; 3+ messages in thread
From: Hugh Dickins @ 2018-05-31  3:23 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Mel Gorman, Minchan Kim, Huang, Ying, Jan Kara, linux-kernel, linux-mm

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;

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] mm: fix the NULL mapping case in __isolate_lru_page()
  2018-05-31  3:23 [PATCH] mm: fix the NULL mapping case in __isolate_lru_page() Hugh Dickins
@ 2018-05-31  5:03 ` Minchan Kim
  2018-05-31  7:26 ` Mel Gorman
  1 sibling, 0 replies; 3+ messages in thread
From: Minchan Kim @ 2018-05-31  5:03 UTC (permalink / raw)
  To: Hugh Dickins
  Cc: Andrew Morton, Mel Gorman, Huang, Ying, Jan Kara, linux-kernel, linux-mm

On Wed, May 30, 2018 at 08:23:16PM -0700, Hugh Dickins wrote:
> 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>
Acked-by: Minchan Kim <minchan@kernel.org>

Thanks, Hugh.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] mm: fix the NULL mapping case in __isolate_lru_page()
  2018-05-31  3:23 [PATCH] mm: fix the NULL mapping case in __isolate_lru_page() Hugh Dickins
  2018-05-31  5:03 ` Minchan Kim
@ 2018-05-31  7:26 ` Mel Gorman
  1 sibling, 0 replies; 3+ messages in thread
From: Mel Gorman @ 2018-05-31  7:26 UTC (permalink / raw)
  To: Hugh Dickins
  Cc: Andrew Morton, Minchan Kim, Huang, Ying, Jan Kara, linux-kernel,
	linux-mm

On Wed, May 30, 2018 at 08:23:16PM -0700, Hugh Dickins wrote:
> 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>

Acked-by: Mel Gorman <mgorman@techsingularity.net>

-- 
Mel Gorman
SUSE Labs

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-05-31  7:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-31  3:23 [PATCH] mm: fix the NULL mapping case in __isolate_lru_page() Hugh Dickins
2018-05-31  5:03 ` Minchan Kim
2018-05-31  7:26 ` Mel Gorman

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.