Re: [PATCH 1/2] mm: page allocator: Adjust the per-cpu counter threshold when memory is low

From: KOSAKI Motohiro
Date: Mon Nov 01 2010 - 03:07:41 EST


> To ensure that kswapd wakes up, a safe version of zone_watermark_ok()
> is introduced that takes a more accurate reading of NR_FREE_PAGES when
> called from wakeup_kswapd, when deciding whether it is really safe to go
> back to sleep in sleeping_prematurely() and when deciding if a zone is
> really balanced or not in balance_pgdat(). We are still using an expensive
> function but limiting how often it is called.
>
> When the test case is reproduced, the time spent in the watermark functions
> is reduced. The following report is on the percentage of time spent
> cumulatively spent in the functions zone_nr_free_pages(), zone_watermark_ok(),
> __zone_watermark_ok(), zone_watermark_ok_safe(), zone_page_state_snapshot(),
> zone_page_state().
>
> vanilla 11.6615%
> disable-threshold 0.2584%
>
> Reported-by: Shaohua Li <shaohua.li@xxxxxxxxx>
> Signed-off-by: Mel Gorman <mel@xxxxxxxxx>

Except kamezawa-san pointed piece

Reviewed-by: KOSAKI Motohiro <kosaki.motohiro@xxxxxxxxxxxxxx>


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/