* [PATCH] mm:vmscan:replace zone_watermark_ok with zone_balanced for determining if kswapd will call compaction
@ 2014-06-22 8:51 Chen Yucong
2014-06-23 11:15 ` Mel Gorman
0 siblings, 1 reply; 2+ messages in thread
From: Chen Yucong @ 2014-06-22 8:51 UTC (permalink / raw)
To: mgorman; +Cc: hannes, mhocko, riel, akpm, linux-mm, linux-kernel, Chen Yucong
According to the commit messages of "mm: vmscan: fix endless loop in kswapd balancing"
and "mm: vmscan: decide whether to compact the pgdat based on reclaim progress", minor
change is required to the following snippet.
/*
* If any zone is currently balanced then kswapd will
* not call compaction as it is expected that the
* necessary pages are already available.
*/
if (pgdat_needs_compaction &&
zone_watermark_ok(zone, order,
low_wmark_pages(zone),
*classzone_idx, 0))
pgdat_needs_compaction = false;
zone_watermark_ok() should be replaced by zone_balanced() in the above snippet. That's
because zone_balanced() is more suitable for the context.
Signed-off-by: Chen Yucong <slaoub@gmail.com>
---
mm/vmscan.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/mm/vmscan.c b/mm/vmscan.c
index a8ffe4e..e1004ad 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -3157,9 +3157,8 @@ static unsigned long balance_pgdat(pg_data_t *pgdat, int order,
* necessary pages are already available.
*/
if (pgdat_needs_compaction &&
- zone_watermark_ok(zone, order,
- low_wmark_pages(zone),
- *classzone_idx, 0))
+ zone_balanced(zone, order, 0,
+ *classzone_idx))
pgdat_needs_compaction = false;
}
--
1.7.10.4
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] mm:vmscan:replace zone_watermark_ok with zone_balanced for determining if kswapd will call compaction
2014-06-22 8:51 [PATCH] mm:vmscan:replace zone_watermark_ok with zone_balanced for determining if kswapd will call compaction Chen Yucong
@ 2014-06-23 11:15 ` Mel Gorman
0 siblings, 0 replies; 2+ messages in thread
From: Mel Gorman @ 2014-06-23 11:15 UTC (permalink / raw)
To: Chen Yucong; +Cc: hannes, mhocko, riel, akpm, linux-mm, linux-kernel
On Sun, Jun 22, 2014 at 04:51:00PM +0800, Chen Yucong wrote:
> According to the commit messages of "mm: vmscan: fix endless loop in kswapd balancing"
> and "mm: vmscan: decide whether to compact the pgdat based on reclaim progress", minor
> change is required to the following snippet.
>
> /*
> * If any zone is currently balanced then kswapd will
> * not call compaction as it is expected that the
> * necessary pages are already available.
> */
> if (pgdat_needs_compaction &&
> zone_watermark_ok(zone, order,
> low_wmark_pages(zone),
> *classzone_idx, 0))
> pgdat_needs_compaction = false;
>
> zone_watermark_ok() should be replaced by zone_balanced() in the above snippet. That's
> because zone_balanced() is more suitable for the context.
>
What bug does this fix?
The intent here is to prevent kswapd compacting a node if an allocation
request within that node would succeed against the low watermark.
Your change alters that to check against hte high watermark + balance gap
without explaining why kswapd should compact until the high watermark is
reached.
--
Mel Gorman
SUSE Labs
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-06-23 11:15 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-22 8:51 [PATCH] mm:vmscan:replace zone_watermark_ok with zone_balanced for determining if kswapd will call compaction Chen Yucong
2014-06-23 11:15 ` Mel Gorman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).