[lkml]   [2012]   [Jan]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
SubjectRe: [PATCH] mm: vmscan: fix setting reclaim mode
On Tue, Jan 10, 2012 at 5:44 PM, Mel Gorman <> wrote:
> On Sun, Jan 08, 2012 at 03:05:03PM +0800, Hillf Danton wrote:
>> 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.
> No explanation of problem, how this patch fixes it or what the impact
> is.
> At a glance, this will have the impact of using sync reclaim at low
> reclaim priorities. This is unexpected so needs much better explanation.

Hi Mel

It is reprepared, please review again.


===cut please===
From: Hillf Danton <>
[PATCH] mm: vmscan: fix setting reclaim mode

The comment says, initially assume we are entering either lumpy reclaim or
reclaim/compaction, and depending on the reclaim order, we will either set the
sync mode or just reclaim order-0 pages later.

On other hand, order-0 reclaim, instead of sync reclaim, is expected when
under memory pressure, but the check for memory pressure is incorrect,
leading to sync reclaim at low reclaim priorities.

And the result is sync reclaim is set for high priorities.

Cc: KAMEZAWA Hiroyuki <>
Cc: David Rientjes <>
Cc: Mel Gorman <>
Cc: Andrew Morton <>
Signed-off-by: Hillf Danton <>

--- a/mm/vmscan.c Thu Dec 29 20:20:16 2011
+++ b/mm/vmscan.c Tue Jan 10 23:03:48 2012
@@ -387,7 +387,7 @@ static void set_reclaim_mode(int priorit
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;

 \ /
  Last update: 2012-01-10 17:01    [W:0.069 / U:1.864 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site