Skip to contentSkip to conversation

mm, compaction: don't isolate PageWriteback pages in MIGRATE_SYNC_LIGHT mode

PATCH New [email protected] 1 participant 1 message Jul 28, 2016

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

PATCH 84/101 mm, compaction: don't isolate PageWriteback pages in MIGRATE_SYNC_LIGHT mode

From: Hugh Dickins <[email protected]>
Subject: mm, compaction: don't isolate PageWriteback pages in MIGRATE_SYNC_LIGHT mode

At present MIGRATE_SYNC_LIGHT is allowing __isolate_lru_page() to isolate a PageWriteback page, which __unmap_and_move() then rejects with -EBUSY:
of course the writeback might complete in between, but that's not what we usually expect, so probably better not to isolate it.

When tested by stress-highalloc from mmtests, this has reduced the number of page migrate failures by 60-70%.

---

 mm/compaction.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/compaction.c renamed from mm/compaction.c~mm-compaction-dont-isolate-pagewriteback-pages-in-migrate_sync_light-mode +1 -1
diff -puN mm/compaction.c~mm-compaction-dont-isolate-pagewriteback-pages-in-migrate_sync_light-mode mm/compaction.c
@@ -1200,7 +1200,7 @@ static isolate_migrate_t isolate_migrate
 	struct page *page;
 	const isolate_mode_t isolate_mode =
 		(sysctl_compact_unevictable_allowed ? ISOLATE_UNEVICTABLE : 0) |
-		(cc->mode == MIGRATE_ASYNC ? ISOLATE_ASYNC_MIGRATE : 0);
+		(cc->mode != MIGRATE_SYNC ? ISOLATE_ASYNC_MIGRATE : 0);
 
 	/*
 	 * Start at where we last stopped, or beginning of the zone as

_