LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Debian swapd package stopped working after Kernel 2.6.8 (https://www.linuxquestions.org/questions/linux-software-2/debian-swapd-package-stopped-working-after-kernel-2-6-8-a-439827/)

sixerjman 04-28-2006 06:58 PM

Debian swapd package stopped working after Kernel 2.6.8
 
This is driving me nuts because I had swapd working with kernel 2.4.27, but I remember I had to do some tweaking to get it going...but I can't remember what the tweaks were.
Now I've had at least one instance where the system ran out of memory and started thrashing which resulted in a VERY non-graceful shutdown (had to pull the plug).

I seem to remember seeing that the util-linux package had to be downgraded for swapd to work but am not sure.

Symptoms are as follows:

1. Increased "memlimit" in /etc/swapd.conf from 32K to 128K to test.
2. In Gnome crank up a bunch of Mozilla processes including some web pages with Java.
3. See free memory using 'free' fall below 128K, no swap files created.

I guess I'll compile it with debug set to yes and see what
happens. Also, do the mkswap that it (should) do manually
and see what happens.

I know I'm not the only person that's had this problem...I've had it twice and I'm a much different person than when I had the problem originally lol.

Any tips on this would be greatly appreciated. :p

sixerjman 04-30-2006 03:22 PM

Things started moving, i.e. swap files created, removed, after I 'primed' it by manually creating one swap file with:

1. dd if=/dev/zero of=/swap/linux0.swp bs=1024 count=8192
2. mkswap /swap/linux0.swp
3. swapon /swap/linux0.swp

swapd should do this anyway so I don't know why it didn't. Got close to the 'production' 32Mb free limit just now so I'm going to prime again and see what happens. Other thing it (swapd) is supposed to do (and has in the past) is reuse swap files it finds already there at init time, so I'll test this too.

sixerjman 05-02-2006 05:08 PM

FOUND and FIXED the bug
 
function usedswaps() is returning an incorrect count of the number of lines in /proc/swaps. Subsequently the line
that determines

if (mem < memlimit && (!maxswaps || kswaps < maxswaps))

always fails if no swap files existed and maxswaps (from the config file /etc/swapd.conf) was non-zero.

Fix was to set 'count' equal to zero in usedswaps() function (previously it was set to -1).

All bugs must be killed. :)


All times are GMT -5. The time now is 10:50 PM.