[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJd=RBAqzawZ=jEFt7TrZgU0gaejMkfiBxzH7Y19qqNnsZrJGw@mail.gmail.com>
Date: Sun, 8 Jan 2012 15:05:03 +0800
From: Hillf Danton <dhillf@...il.com>
To: linux-mm@...ck.org
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>,
David Rientjes <rientjes@...gle.com>,
Mel Gorman <mgorman@...e.de>,
Andrew Morton <akpm@...ux-foundation.org>,
LKML <linux-kernel@...r.kernel.org>,
Hillf Danton <dhillf@...il.com>
Subject: [PATCH] mm: vmscan: fix setting reclaim mode
The check for under memory pressure is corrected, then lumpy reclaim or
reclaim/compaction could be avoided either when for order-O reclaim or
when free pages are already low enough.
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>
Cc: David Rientjes <rientjes@...gle.com>
Cc: Mel Gorman <mgorman@...e.de>
Cc: Andrew Morton <akpm@...ux-foundation.org>
Signed-off-by: Hillf Danton <dhillf@...il.com>
---
--- a/mm/vmscan.c Thu Dec 29 20:20:16 2011
+++ b/mm/vmscan.c Sun Jan 8 13:22:12 2012
@@ -365,8 +365,7 @@ out:
return ret;
}
-static void set_reclaim_mode(int priority, struct scan_control *sc,
- bool sync)
+static void set_reclaim_mode(int priority, struct scan_control *sc, bool sync)
{
reclaim_mode_t syncmode = sync ? RECLAIM_MODE_SYNC : RECLAIM_MODE_ASYNC;
@@ -381,13 +380,12 @@ static void set_reclaim_mode(int priorit
sc->reclaim_mode = RECLAIM_MODE_LUMPYRECLAIM;
/*
- * Avoid using lumpy reclaim or reclaim/compaction if possible by
- * restricting when its set to either costly allocations or when
- * under memory pressure
+ * Avoid lumpy reclaim or reclaim/compaction either
+ * when for order-O reclaim or when under memory pressure
*/
if (sc->order > PAGE_ALLOC_COSTLY_ORDER)
sc->reclaim_mode |= syncmode;
- else if (sc->order && priority < DEF_PRIORITY - 2)
+ else if (sc->order && priority >= DEF_PRIORITY - 2)
sc->reclaim_mode |= syncmode;
else
sc->reclaim_mode = RECLAIM_MODE_SINGLE | RECLAIM_MODE_ASYNC;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists