Re: kswapd craziness in 3.7

From: Zlatko Calusic
Date: Sat Dec 08 2012 - 16:22:08 EST


On 08.12.2012 13:06, Zlatko Calusic wrote:
On 06.12.2012 20:31, Linus Torvalds wrote:
Ok, people seem to be reporting success.

I've applied Johannes' last patch with the new tested-by tags.


I've been testing this patch since it was applied, and it certainly
fixes the kswapd craziness issue, good work Johannes!

But, it's still not perfect yet, because I see that the system keeps
lots of memory unused (free), where it previously used it all for the
page cache (there's enough fs activity to warrant it).

I'm now testing the last piece of Johannes' changes (still not in git
tree), and can report results in 24-48 hours.

Regards,

Or sooner... in short: nothing's changed!

On a 4GB RAM system, where applications use close to 2GB, kswapd likes to keep around 1GB free (unused), leaving only 1GB for page/buffer cache. If I force bigger page cache by reading a big file and thus use the unused 1GB of RAM, kswapd will soon (in a matter of minutes) evict those (or other) pages out and once again keep unused memory close to 1GB.

I guess it's not a showstopper, but it still counts as a very bad memory management, wasting lots of RAM.

As an additional data point, if memory pressure is slightly higher (say backup kicks in, keeping page cache mostly full) kswapd gets in D (uninterruptible sleep) state (function: congestion_wait) and load average goes up by 1. It recovers only when it successfully throws out half of page cache again.

Hope it helps.
--
Zlatko
--
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/