Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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)?
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.
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 know this is years later, but I'm having what seems like a similar problem with Linux kernel version 2.6.18 although I don't have the capability to instrument the kernel to be sure.
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?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.