You are not logged in.
This process kswapd (kswapd0, actually) suddenly starts using 100% of one of my cores for no good reason, usually when moving many GBs around, but sometimes for no good reason at all.
I have no swap.
It also prevents the computer from sucessfully suspending. Only way to go back to normal is rebooting.
I found nothing here or in the Wiki, and I'm posting this here since it seems to be a kernel related issue.
Offline
A web search about this had lots of returns.
Seems there's memory pressures and kswapd is endlessly looking for swap to use, at least that was the most common situation.
You're just jealous because the voices only talk to me.
Offline
I had the same issue on a sandy bridge machine of mine, this was fixed with a kernel update (I think it was 3.0).
does this bring your machine back to normal when it is running at 100%?
echo 3 > /proc/sys/vm/drop_caches
I actually ran this as a cron job every few minutes back then as a workaround without knowing what it actually does.
Offline
That command did nothing, but I noticed that sometimes the problem appears and goes away spontaneously.
Offline
That command did nothing, but I noticed that sometimes the problem appears and goes away spontaneously.
have you tried linux-mainline from the AUR? If you are lucky it's fixed there.
Offline
Still not fixed for me in 3.6.3
Offline
I didn't have this problem until a few days ago with linux-mainline-3.7rc2. Before this version I have been using various versions of the linux-kx-ck and linux-mainline kernel without this problem.
To make the computer usable I've put kswap0 on a lower priority:
schedtool -D -n 19 `pidof kswapd0`
Output of top:
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
21 root 39 19 0 0 0 R 98.5 0.0 944:00.92 kswapd0
3092 root 18 -2 82080 38m 17m S 0.3 1.9 21:54.12 X
3225 eric -2 -3 288m 52m 28m S 0.3 2.6 7:21.26 kwin
Offline
Just bumped to this issue. Kswapd0 consumed 100% cpu for a while and everything went fine in 2-3 minutes. I have no swap.
Offline
Haven't rebooted my netbook (Atom N270, i686, 1 GB ram) for a few weeks. After the latest update of linux-mainline from miffe's repo + a reboot a few days ago it started for me too. It just happened for the second time in those few days.
3.7rc3-1
Dropping caches doesn't affect anything.
After echo 3 > /proc/sys/vm/drop_caches:
# free -m
total used free shared buffers cached
Mem: 1000 415 584 0 1 39
-/+ buffers/cache: 373 626
Swap: 0 0 0
I wanted to try if kswapd0 would calm down when turning on swap (just an idea), so I tried to create a file with "dd if=/dev/zero of=/data/swapfile bs=1M count=1000" and while doing that, kswapd0 stopped doing whatever it was doing. Coincidence? Maybe. The last time it went on for quite much longer and I just rebooted without trying things.
edit: happened again and almost instantly after starting the dd kswapd0 stopped consuming cpu cycles. I don't think it's coincidence.
edit2: So after dd it will happen more frequently. The threshold seems to be about 285 megabyte written to the disk (>400 megabyte are cached afterwards). Less and kswapd0 won't stop. Written to /dev/null and it won't stop either, it needs to be written to the disk. Very interesting.
Last edited by Cdh (2012-11-03 20:46:33)
฿ 18PRsqbZCrwPUrVnJe1BZvza7bwSDbpxZz
Offline
Still here in 3.7.1. Got it on video http://youtu.be/_-kT4dLVKLk
To temporary trigger this bug, run dd bs=1M count=2000 if=/dev/zero of=file.spin and watch for kswapd0 IO abuse.
Offline
I've discovered that this issue can occur if you have bad RAM. it's doesn't seem to occur with the lts kernel but this could be because the newer kernel caches much more agressively. I finally found this issue due to random CRC errors occuring when unraring some big files. memtest however showed no errors but is known for not being very reliable for stability testing. This used to occur daily for me but since I've swapped out my RAM it's disappeared.
I still don't understand why kswapd spends anytime waiting for IO when there is no swap though.
Offline
This issue has started to affect me since kernel 3.7.8. I have tried turning swap on and off, and setting kswapd0 to a lower priority, but those things have no effect.
If kswapd0 pegs one of my cores I can start closing programs until the problem clears, but if it pegs both cores (which is much more common), I'm essentially forced to hard reset. I've tried waiting as long as an hour in that situation and the problem never resolves. Everything is totally unresponsive other than the cursor being able to be moved with a massive delay.
Teach not that I died in vain; rather, teach that I did not die by demonstrating that I live in you.--- ACIM
Offline
I have the same problem. Linux hertz 3.12.1-1-ARCH #1 SMP PREEMPT Thu Nov 21 08:18:42 CET 2013 x86_64 GNU/Linux
Did anyone find a fix?
Last edited by Munksgaard (2013-12-12 14:41:20)
Offline
I can confirm issue on 3.12.5-1-ck
Offline
Just noticed this here
$ uname -a
Linux -- 3.12.4-1-ARCH #1 SMP PREEMPT Sun Dec 8 21:18:00 CET 2013 x86_64 GNU/Linux
Of couse, I'm running Windows in a VM and have pressure on memory resouces (80% used).
I've also got a swap fill that 120% of memory which is barely (1.3%) used.
(And, yes, I will be doubling my RAM this Christmas.)
Last edited by bartonc (2013-12-16 10:59:57)
Offline
Same issue on a machine running 3.11.6-1-ARCH; sometimes some random memory-allocation will result in kswapd0 and kswapd1 running at 100% resulting in a high load. This machine has no swap configured. Since it has ECC ram; I'm pretty sure it's not a hardware problem. This machine has 32Gb memory with only 8 Gb actively in use.
Does anyone have any explanation as to what kswapd is doing while there is no swap configured? I have been able to 'fix' this by running echo 1 > /proc/sys/vm/drop_caches
Offline
Seeing as this hasn't been solved for quite a long time, maybe one of you guys should make a bug report upstream.
Offline
Has anyone reported this bug or found a more permanent fix? If not, I'll try to see if I can figure out how to report it; I am having the same problem.
Offline
Add a swapfile or use zram (zramswap package from AUR).
Offline
FWIW, I just encountered this issue on Ubuntu 12.04.4 LTS running kernel 3.13.0-26-generic #48~precise1-Ubuntu.
I then noticed that I hadn't updated my fstab to point to the correct swap partition (so I had no swap). I did that, then used swapon -a to turn it on, while running top in another terminal.
125MB was immediately written to the swap partition, and kswapd0's CPU usage stopped.
Offline
I have the same problem on last kernel 3.15.5-1. No problem on linux-lts or linux-rt. The system is without swap and with vm.swappiness = 0.
I had to install zramswap and now high CPU after moving/downloading some big files has disappeared.
This bug is not resolved yet.
Last edited by hifi25nl (2014-07-14 13:45:54)
Offline
Fun fact: the issue is described in IBM support pages and it references this thread as a source. And they don't know of a fix either!
All of the above is a personal opinion and does not represent the views of my granny's dog or the projects to which I contribute.
Offline
Me too, for what it's worth. Thinkpad Helix with only (!) 4 GB RAM, so running KDE and Qt Creator and trying to get work done is enough to create memory pressure. kernel 3.14 (which I keep using because of a not-yet-merged patch to support some sensors). schedtool -D -n 19 `pidof kswapd0` did seem to help.
Last edited by ecloud (2014-11-27 15:14:31)
Offline
Hi,
Hope it's not too late. And someone will be able to test my suggestion.
just noticed the same on RHEL6.3 and just wanted to say, maybe you can try XFS not ext4 ?
As I understand it's a booody ext with it's new features on ext4...
----------------- edit 1 ------------------
P.S. changing priority to lower it's not a solving issue, just fixing it for today...
----------------- edit 2 ------------------
also noticed on my RHEL box, that I also have big disk IO for these kswap0 issues, also jbd2 process is striking for io... check it with iotop.
Last edited by BiG_NoBoDy (2015-01-07 06:41:46)
Offline
I have XFS and a 3.13.6 kernel.
I just googled "LulzSec" and suddenly this kswapd problem appeared. Hope it's a coincidence :)
I still had 20 GiB free memory (no swap), but when I did as they recommend here
echo 3 > /proc/sys/vm/drop_caches
the problem disappeared. So I think it actually does something.
maybe you can try XFS not ext4 ?
I wouldn't recommend XFS unless you have a RAID array or an SSD. My experience with XFS was very much frustrating.
I have one 15K SAS direct attach drive, and it has a bad block now (and I can't re-allocate it using scu.d), and I've found out that XFS does not really support bad blocks. I can't fix the issue without re-booting! (that's how you solved problems back in the days of Windows 98).
Second, it's performance on such a setup is just horrible compared to ext3.
Moreover, my kernel version is plagued by an XFS bug when everything hangs suddenly. They call it something like a spontaneous bug that happens on "innocuous desktop workloads".
On the positive side, it does allow filesystem checks and de-fragmentations without re-booting, which ext4 doesn't.
Last edited by articice (2015-12-24 13:24:54)
Offline