kswapd 100% CPU
Hi All,
Description: I countered a weird problem with kswapd: it runs in some infinite loop trying to swap until order 10 of zone highmem is OK, While zone higmem (as I understand) has nothing to do with continuous memory (cause there is no 1-1 mapping) which means kswapd will continue to try to balance order 10 of zone highmem forever (or until someone release a very large chunk of highmem). Can anyone please explain me the algorithm of kswapd and why it trys to balance order 10 of zone higmem ? Details: I build an instrumented kernel with debug messages in "zone_watermark_ok" function, and from the code and debug messages I see that "zone_watermark_ok" returns 0 when kswapd invokes it (through balance_pgdat) in order to decide if zone highmem is balanced or not, which lead in some configurations to infinite loop of kswapd ( if no large chunks of highmem released) . I added a condition to "balance_pgdat" so it doesn't try to balance order higher than 1 in zone highmem and this conditon solved the problem, what are the risks with such solution? isn't it a bug that kswapd is looking for continuous memory in zone highmem ( as I understand there is no 1-1 mapping in zone highmem which is meaningless in kswapd)? |
I'm wondering, does only one specific or more kernel versions exhibit this behaviour? Did you ever go on the LKML with this?
|
KSWAPD algorithm
First thank you for your reply :)
I encountered it on kernel 2.6.18, I don't know how to reach the people in LKML cause as I see it it might be a bug in the KSWAPD algorithm. |
Quote:
Quote:
|
Is this problem fixed in later versions of Linux
Quote:
There is a patch available titled "prevent kswapd from freeing excessive amounts of lowmem", which I think is in the 2.6.24 kernel. wassim_dagash, did a later version of Linux fix your problem? Ben Slade |
Hey,
Version 2.6.18 does NOT include any patches regarding this issue, if I recall correctly it would be added on 2.6.32 or later. |
All times are GMT -5. The time now is 07:22 AM. |