[kde-linux] VM and Swap problems

Randy Kramer rhkramer at gmail.com
Mon Feb 12 01:01:20 UTC 2007


On Sunday 11 February 2007 01:22 am, James Richard Tyrer wrote:
> > The VM and swap work fine till the swap space is half full.  But, after 
> > swap is half full the system starts removing swap until it is exactly 
> > half full.  When this happens, the VM system starts to thrash and the 
> > system won't do anything till the thrashing stops.

I'm not the OP, but thanks very much--this is useful information.  (But 
actually, on the next system I set up (and maybe even on this one), I'm going 
to significantly increase the size of swap so it will take much longer or be 
less likely to ever get half full.)

> After some research, I found two idea.
> 
> 1.      Increase 'swappiness'.  This seems to help a little.  To do this, as 
> root in a Konsole:
> 
>         echo 100 > /proc/sys/vm/swappiness

Hmm, somebody suggested this to me, also, but I went in the other direction 
(down) and the results weren't very satisfactory (I started using a lot of 
swap).  I should try this.
 
> 2.      Disable "pflush" daemons from running by default.  This is a very 
> strange idea but it works.  You have to compile your Kernel to do this. 
>   In: /usr/src/linux/mm/pflush.c change:
> 
>         #define MIN_PDFLUSH_THREADS     0
>         #define MAX_PDFLUSH_THREADS     2
> 
> I set MAX_PDFLUSH_THREADS to 2 because that is the number of hard disks 
> that I have.  I don't know if they ever start but this would allow the 
> Kernel to start them if it wants to.
> 
> This is a sledge hammer approach and I presume that other changes to 
> "pflush.c" would accomplish the same result.  So, far, I have not 
> figured out how it knows to start using "pflush" when stop becomes half 
> full.
> 
> After doing these two things my system runs much better.  It gets a bit 
> sluggish when swap is full, but you would expect that and it isn't as 
> bad as it was at half full with "pflush" running. 

Thanks for the above--it's good to hear that there is apparently some logical 
explanation for the slowdown when swap is half full (and thus it wasn't just 
my imagination--well, I knew it wasn't my imagination, but it was hard to 
convince anybody of that).

Randy Kramer




More information about the kde-linux mailing list