lkml.org 
[lkml]   [2012]   [Mar]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] Re: kswapd stuck using 100% CPU
On Sat, 24 Mar 2012, Rik van Riel wrote:
>
> Only test compaction_suitable if the kernel is built with CONFIG_COMPACTION,
> otherwise the stub compaction_suitable function will always return
> COMPACT_SKIPPED and send kswapd into an infinite loop.
>
> Signed-off-by: Rik van Riel <riel@redhat.com>
> Reported-by: Anton Blanchard <anton@samba.org>

Thank you, Anton and Rik. I never quite got around to investigating
why swapping had been nearly twice as slow with linux-next on my Aspire
One (with a relatively minimal config, omitting COMPACTION). That was
the reason (one half of the HT cpu busy in kswapd), and this fixes it.

Tested-by: Hugh Dickins <hughd@google.com>

>
> diff --git a/mm/vmscan.c b/mm/vmscan.c
> index 7658fd6..33c332b 100644
> --- a/mm/vmscan.c
> +++ b/mm/vmscan.c
> @@ -2946,7 +2946,8 @@ out:
> continue;
>
> /* Would compaction fail due to lack of free memory? */
> - if (compaction_suitable(zone, order) == COMPACT_SKIPPED)
> + if (COMPACTION_BUILD &&
> + compaction_suitable(zone, order) == COMPACT_SKIPPED)
> goto loop_again;
>
> /* Confirm the zone is balanced for order-0 */


\
 
 \ /
  Last update: 2012-03-25 21:19    [W:0.374 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site