LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 12-01-2008, 07:57 AM   #1
wassim_dagash
LQ Newbie
 
Registered: Dec 2008
Posts: 3

Rep: Reputation: 0
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)?
 
Old 12-02-2008, 05:50 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
I'm wondering, does only one specific or more kernel versions exhibit this behaviour? Did you ever go on the LKML with this?
 
Old 12-03-2008, 12:51 AM   #3
wassim_dagash
LQ Newbie
 
Registered: Dec 2008
Posts: 3

Original Poster
Rep: Reputation: 0
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.
 
Old 12-03-2008, 04:12 PM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by wassim_dagash View Post
I encountered it on kernel 2.6.18
Better try a recent one first then?


Quote:
Originally Posted by wassim_dagash View Post
I don't know how to reach the people in LKML
The LKML is at lkml.org. Maybe read http://www.kernel.org/pub/linux/docs/lkml/ before posting.
 
Old 11-09-2010, 10:31 AM   #5
bslade
LQ Newbie
 
Registered: Nov 2010
Posts: 3

Rep: Reputation: 0
Is this problem fixed in later versions of Linux

Quote:
Originally Posted by wassim_dagash View Post
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?

Ben Slade
 
Old 11-10-2010, 01:27 AM   #6
wassim_dagash
LQ Newbie
 
Registered: Dec 2008
Posts: 3

Original Poster
Rep: Reputation: 0
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
cpu 100% Sriram.root AIX 1 06-26-2008 12:09 PM
100% cpu use 100% of the time serafean Linux - Newbie 4 05-04-2006 03:36 PM
cpu ......100%...... mohama Linux - General 23 01-20-2006 10:39 AM
100 % Cpu Volcano Linux - Newbie 27 10-05-2005 10:58 PM
cpu nearly always at 100% xround Linux - Hardware 6 09-17-2004 05:51 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 07:24 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration