This is a note to let you know that I've just added the patch titled
mm: compaction: make isolate_lru_page() filter-aware again
to the 3.0-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
mm-compaction-make-isolate_lru_page-filter-aware-again.patch
and it can be found in the queue-3.0 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <[email protected]> know about it.
>From c82449352854ff09e43062246af86bdeb628f0c3 Mon Sep 17 00:00:00 2001
From: Mel Gorman <[email protected]>
Date: Thu, 12 Jan 2012 17:19:38 -0800
Subject: mm: compaction: make isolate_lru_page() filter-aware again
From: Mel Gorman <[email protected]>
commit c82449352854ff09e43062246af86bdeb628f0c3 upstream.
Stable note: Not tracked in Bugzilla. A fix aimed at preserving page aging
information by reducing LRU list churning had the side-effect of
reducing THP allocation success rates. This was part of a series
to restore the success rates while preserving the reclaim fix.
Commit 39deaf85 ("mm: compaction: make isolate_lru_page() filter-aware")
noted that compaction does not migrate dirty or writeback pages and that
is was meaningless to pick the page and re-add it to the LRU list. This
had to be partially reverted because some dirty pages can be migrated by
compaction without blocking.
This patch updates "mm: compaction: make isolate_lru_page" by skipping
over pages that migration has no possibility of migrating to minimise LRU
disruption.
Signed-off-by: Mel Gorman <[email protected]>
Reviewed-by: Rik van Riel<[email protected]>
Cc: Andrea Arcangeli <[email protected]>
Reviewed-by: Minchan Kim <[email protected]>
Cc: Dave Jones <[email protected]>
Cc: Jan Kara <[email protected]>
Cc: Andy Isaacson <[email protected]>
Cc: Nai Xia <[email protected]>
Cc: Johannes Weiner <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
include/linux/mmzone.h | 2 ++
mm/compaction.c | 3 +++
mm/vmscan.c | 35 +++++++++++++++++++++++++++++++++--
3 files changed, 38 insertions(+), 2 deletions(-)
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -166,6 +166,8 @@ static inline int is_unevictable_lru(enu
#define ISOLATE_CLEAN ((__force isolate_mode_t)0x4)
/* Isolate unmapped file */
#define ISOLATE_UNMAPPED ((__force isolate_mode_t)0x8)
+/* Isolate for asynchronous migration */
+#define ISOLATE_ASYNC_MIGRATE ((__force isolate_mode_t)0x10)
/* LRU Isolation modes. */
typedef unsigned __bitwise__ isolate_mode_t;
--- a/mm/compaction.c
+++ b/mm/compaction.c
@@ -371,6 +371,9 @@ static isolate_migrate_t isolate_migrate
continue;
}
+ if (!cc->sync)
+ mode |= ISOLATE_ASYNC_MIGRATE;
+
/* Try isolate the page */
if (__isolate_lru_page(page, mode, 0) != 0)
continue;
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -1045,8 +1045,39 @@ int __isolate_lru_page(struct page *page
ret = -EBUSY;
- if ((mode & ISOLATE_CLEAN) && (PageDirty(page) || PageWriteback(page)))
- return ret;
+ /*
+ * To minimise LRU disruption, the caller can indicate that it only
+ * wants to isolate pages it will be able to operate on without
+ * blocking - clean pages for the most part.
+ *
+ * ISOLATE_CLEAN means that only clean pages should be isolated. This
+ * is used by reclaim when it is cannot write to backing storage
+ *
+ * ISOLATE_ASYNC_MIGRATE is used to indicate that it only wants to pages
+ * that it is possible to migrate without blocking
+ */
+ if (mode & (ISOLATE_CLEAN|ISOLATE_ASYNC_MIGRATE)) {
+ /* All the caller can do on PageWriteback is block */
+ if (PageWriteback(page))
+ return ret;
+
+ if (PageDirty(page)) {
+ struct address_space *mapping;
+
+ /* ISOLATE_CLEAN means only clean pages */
+ if (mode & ISOLATE_CLEAN)
+ return ret;
+
+ /*
+ * Only pages without mappings or that have a
+ * ->migratepage callback are possible to migrate
+ * without blocking
+ */
+ mapping = page_mapping(page);
+ if (mapping && !mapping->a_ops->migratepage)
+ return ret;
+ }
+ }
if ((mode & ISOLATE_UNMAPPED) && page_mapped(page))
return ret;
Patches currently in stable-queue which might be from [email protected] are
queue-3.0/vmscan-clear-zone_congested-for-zone-with-good-watermark.patch
queue-3.0/mm-compaction-allow-compaction-to-isolate-dirty-pages.patch
queue-3.0/mm-page-allocator-do-not-call-direct-reclaim-for-thp-allocations-while-compaction-is-deferred.patch
queue-3.0/mm-zone_reclaim-make-isolate_lru_page-filter-aware.patch
queue-3.0/vmscan-add-shrink_slab-tracepoints.patch
queue-3.0/mm-change-isolate-mode-from-define-to-bitwise-type.patch
queue-3.0/mm-migration-clean-up-unmap_and_move.patch
queue-3.0/mm-compaction-introduce-sync-light-migration-for-use-by-compaction.patch
queue-3.0/kswapd-avoid-unnecessary-rebalance-after-an-unsuccessful-balancing.patch
queue-3.0/mm-compaction-trivial-clean-up-in-acct_isolated.patch
queue-3.0/kswapd-assign-new_order-and-new_classzone_idx-after-wakeup-in-sleeping.patch
queue-3.0/vmscan-reduce-wind-up-shrinker-nr-when-shrinker-can-t-do-work.patch
queue-3.0/vmscan-shrinker-nr-updates-race-and-go-wrong.patch
queue-3.0/mm-compaction-make-isolate_lru_page-filter-aware-again.patch
queue-3.0/mm-vmstat.c-cache-align-vm_stat.patch
queue-3.0/mm-compaction-determine-if-dirty-pages-can-be-migrated-without-blocking-within-migratepage.patch
queue-3.0/mm-memory-hotplug-check-if-pages-are-correctly-reserved-on-a-per-section-basis.patch
queue-3.0/vmscan-limit-direct-reclaim-for-higher-order-allocations.patch
queue-3.0/mm-vmscan-fix-force-scanning-small-targets-without-swap.patch
queue-3.0/mm-compaction-make-isolate_lru_page-filter-aware.patch
queue-3.0/mm-reduce-the-amount-of-work-done-when-updating-min_free_kbytes.patch
queue-3.0/vmscan-abort-reclaim-compaction-if-compaction-can-proceed.patch
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html