kswapd0 100% cpu usage

Bug #721896 reported by Arkadiy Kulev on 2011-02-19
362
This bug affects 82 people
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Low
Unassigned

Bug Description

After the running the latest ubuntu for at least 2 weeks, I've noticed that kswapd0 started using 100% CPU on one of my cores.
However, I have enough of RAM and not using swap (Swap: 11876344k total, 62336k used).

The only thing I can do to remove the problem is reboot the system.
I'm using Ubuntu 10.04.1 LTS server version without any kernel modifications.

User Unknown (user-unknown) wrote :

Oh, thank Dog, I'm not the only one with this issue.

I had explained that issue at length in the Ubuntu forums, but never got any reply: http://ubuntuforums.org/showthread.php?t=1681368

I, too, noticed this behavior ever since mid-January, I think. for the first weeks, whenever this issue occurred, my machine was barely usable anymore. With (one of?) the recent kernel upgrade, it got a lot better for me: The issue still occurs, but it mostly takes only between 20% and 25% of I/O Wait, so the system is only a little slower than usual. After a while, I think, most of the time after anything between half an hour and two hours, kswapd0 is done with whatever it's doing and the system is back to normal. A solution to speed things up for me is to run 'sudo swapoff -a'. In most cases, the system will be fully usable after a few minutes, as soon as all swap was shoveled back into the physical memory (see forum post, as well).

I'm on Ubuntu 10.04.2 LTS, desktop edition -- with some packages from UbuntuStudio and Linux Mint (PinGUY OS), in case that matters.

Arkadiy Kulev (eth-ethaniel) wrote :

Please click "this bug affects me" on top of the report, so the support could see this faster.

User Unknown (user-unknown) wrote :

Yeah, just did that. Sorry, hadn't seen that function before.

Arkadiy, do you suspend-to-RAM your server, as well? For me, this issue never happened before the first suspend/resume after a full reboot. Might be a coincidence, though, as I barely ever reboot my machine, but suspend it to RAM almost every night.

BTW, I have to revise my previous statement a bit: To this moment kswapd0 has been rattling my HDDs and CPUs for the last 6 hours or so without a break, so it did *not* stop it's strange business on its own this time. I just swapped off everything, and after swapping off for about 5 minutes, the I/O Wait load is finally back to normal (read: 0.0%wa), and my hard disks can get some rest.

Arkadiy Kulev (eth-ethaniel) wrote :

We might have different issues here, I am not getting into swap (my swap is constant at 62 megabytes use).
It's the kswapd0 that is eating up 100% cpu on one of my cores (I have 4, so it's not a big deal for me).

I don't suspend the server, it's up 24/7. It's just that after some time running, kswapd0 starts overloading without reason.

User Unknown (user-unknown) wrote :

When kswapd0 starts going berserk on my machine, my swap is usually not or barely in use (0 or a few kiB of the 3GB). However, once kswapd0 is given some time to be wicked, it will fill up the swap considerately to a point (normally not full but a little over half full, I think; last night it was stuck at around 1.8GB after the fore-mentioned six hours), and then it seems to poke the data in the swap around for minutes and hours, having 'top' display slightly different, higher as well as lower values of memory usage every second without changing very much. During all that time it eats up one of my CPUs at a 100% -- by now, though, apparently with a lower process priority than in January and the first weeks of February, leaving my machine usable as opposed to before.

I guess I will try without suspend-to-RAM for a while to see if it occurs then, as well.

User Unknown (user-unknown) wrote :

I can now confirm that the issue seems unrelated to suspending/resuming. After a continuous uptime of more than 90 hours, my machine just ran into this issue again -- not for the first time within these 90 hours, but for the first time with all previous symptoms and without getting back to normal on its own within a short time.

And this time, it got really bad again, too. Not only one core was maxed out, but most of the time, all four cores were at a 100%, even after closing all running applications (in Gnome), thus the machine was barely usable. Just like back in January.

In case it helps, I attached a log of 'top -i' of the whole thing, dumping its output about every 11 seconds whenever I/O Wait is higher than 5% (if somebody can suggest a better way of tracking this bug, please let me know!). When the issue occurred just now, I wasn't really doing anything different than already the hours before. Sure, I had many applications open and I had only little memory left, but all of these applications had already been open and worked on for a couple of hours prior to the occurrence.

Another thing I noticed when reading Arkadiy's original bug report and his post #4 again: When this issue hits me, in the normal 'top' output, kswapd0 does barely ever show (at least not in the top 17 processes there, sorted by CPU usage). In 'top -i' it appears constantly together with top itself, and sometimes some other processes, mainly 'preload' and 'kondemand/2', flashing by. What eats my CPU is the I/O Wait load on one or multiple cores. As soon as the I/O Wait rises, kswapd0 shows up as idle process (or the other way around...). top always displays it with something between 0% and 4% of CPU and a MEM usage of 0.0%, though.

Whenever this issue occurs, all of top's outputs I've found out so far never display any process as eating all the CPU. So in fact, I don't really know what's going on, and what process is causing it; I only know that kswapd0 always plays some part in it.

So, this might indeed be a different issue than the one Arkadiy reported. Arkadiy, what do you say? Does top show you indeed 100% of CPU usage for kswapd0 itself?

User Unknown (user-unknown) wrote :

Dammit! And here is the attached log I announced...

User Unknown (user-unknown) wrote :

Oh dear... please ignore previous attachment. (Mods, please delete if possible!)

Here is the correct file. Good night!

User Unknown (user-unknown) wrote :

Hello Arkadiy,

have you posted this issue somewhere else and gotten a response there? For the last two days, this kswapd0 related I/O Wait bussiness has really been constantly p***ing me off, even though no swap space was even mounted. And in this bug report it seems like two people don't make enough impact -- well, still assuming we do indeed experience the same issue...

Arkadiy Kulev (eth-ethaniel) wrote :

No, this is the only place, and basically it's the only one it should be.
The fast solution for now is just reboot the server every week or so.

affects: ubuntu → swapd (Ubuntu)
affects: swapd (Ubuntu) → ubuntu
Graham Watson (grahamw-home) wrote :

I get this bug too on my HP Pavilion DV6 laptop. For me it only ever happens after a suspend to ram, and the symptoms are the same. My physical ram is <50% full, but the swap space just fills up and churns the hard disc forever. The system becomes barely usable (mouse pointer even sticks for long lengths of time) even though the CPU is <25% in use. sudo swapoff -a seems to solve the problem after a few minutes.

If some people are finding this happening without having used suspend-to-ram, I would say we either have 2 separate bugs, or the suspend-to-ram feature is at least a catalyst.

Graham Watson (grahamw-home) wrote :

Hmm, just a thought, but what processes if any get triggered after a suspend-to-ram is restored? I just noticed that after running sudo swapoff -a, I now have dpkg running in a background process. Could it actually be a bug in dpkg, meaning that some people always see it after a suspend to ram but others see it whenever their scheduled auto-updates trigger?

Are there any other programs that trigger after a suspend-to-ram?

Graham Watson (grahamw-home) wrote :

Hmm, is it when automatic security updates are pushed out. It may be a coincidence. Can anyone else confirm if they see this pattern?

User Unknown (user-unknown) wrote :

Graham, after testing this by leaving my machine running for several days, I could confirm that it seems not to be directly related to suspend-to-ram. However, I got the feeling that after suspend-to-ram it seems more likely to occur sooner. As an example: with my machine running continuously for days, it took more than three days for this issue to become really bad; with suspend-to-ram, however (computer normally runs far more than 12 hours a day, being suspended over night), it usually already occurred on the second day. Though, I believe, never on the first day.

I don't know if I understood you correctly: does this happen for you directly after resume from suspend-to-ram? At least for me the issue did never occur immediately after resume. Whenever it occurred, it was sporadically and several hours afterwards, but I never really saw any pattern to it, neither did I notice any correlation with dpkg or update-manager. Oh, and Arkadiy's server runs 24/7 without any hibernation or such (see post #4).

User Unknown (user-unknown) wrote :

Oh, I will, of course, have an eye on dpkg and related processes once this happens again. So far, it has not happened for 3 or 4 days on my machine (knock on wood), but I also rebooted twice recently, due to the kernel updates.

Follow_Me (mails-valentin) wrote :

I've facing this issue on a regular basis - 2-3 times a week for a last year. This bug was in 10.04, now it is in 10.10 . I've tried tried to update kernel, build my own from vanila source, build form zen sources - every time the same result. As for me, this issue usualy happens after suspend-resume, and there is only 2 ways to fix that - 1 - reboot, 2 - close everithing I can to free up as much as possible RAM and wait. Sometimes this helps, sometimes not.

My system is: Dell Studio 1535/C2D 9300@2500/4G DDR2/2G swap/All other fs are EXT4

Follow_Me (mails-valentin) wrote :

Nobody cares about this issue, a lot of duplicationg and tickets for other distribudion.

https://bugs.launchpad.net/ubuntu/+bug/484045 (same issue, Unassigned, Expired)
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/689262 (looks like the same issue, Unassigned)
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/595047 (looks like the same issue,confirmed, priority High, Unassigned)
https://www.centos.org/modules/newbb/viewtopic.php?topic_id=28555 (same issue, Unresolved)
http://groups.google.com/group/linux.kernel/browse_thread/thread/910c08e97eb0357e?pli=1 (same issue, Unresolved)

How many people should suffer from this issue to start some work on this problem?

User Unknown (user-unknown) wrote :

I think what we really need to clarify is what we all mean by
"kswapd0 using/causing 100% CPU". Reading through some of the posts here I
get the feeling that some of us (even me) might not really be talking about
the same thing as some of the others, and therefore might indeed have a
similar but completely different issue from this bug report, as Arkadiy
suggested in #4. Unfortunately, he never got back to me on that question.

When I talk about 100% CPU caused by kswapd0 I mean:
1. A very high I/O Wait state (see output of top, in the line "Cpu(s):"
   the value of "x.x%wa") at or close to 25% (if only one core out of four
   is affected) or even much higher (several of the cores), while User and
   System CPU usage ("x.x%us" and "x.x%sy" in top) is rather negligible.
2. In these cases, kswapd0 can only ever be noticed as – the only –
   uninterruptable or idle process, e.g. via 'ps auxww' or 'top -i', while
   in top's normal output, neither kswapd0 nor any other process would
   really stand out for its unusually high CPU consumption.
3. According to 'free', there would still be plenty of physical memory free,
   and also, at least at the time this issue starts, mounted swap space
   (doesn't matter whether both swap partition *and* /dev/ramzswap0 drive
   are currently swapped on or only one of them - check with 'swapon -s')
   would barely be in use, or no swap space would be swapped on at all.

So, who is talking about the exactly same thing?
And more importantly, Arkadiy, did you?

Follow_Me (mails-valentin) wrote :

As for me swap is on, a lot of free memory (~30-40% of 4G ) - but kswapd0 swapping like insane - swapped space = users RAM size

spapping policy - /proc/sys/vm/swappiness = 7

Why it does that?

Tested (affected) kernels: 2.6.35 , 2.6.36, 2.6.37 ,2.6.37-zen , 2.6.38, 2.6.38-zen

tags: added: kswapd
Evan Shechter (eshechter) wrote :

User Unknown, thanks for clarifying (in post #18). I have the same issue as you and have also been wondering exactly what 100% CPU usage means. My case is just like yours - kswapd will take over and swap like mad even when physical memory is only half full. (swappiness setting doesn't seem to matter)

Philip Muškovac (yofel) on 2011-04-02
tags: added: lucid
TragicWarrior (bryan-christ) wrote :

I just thought I would shed some light on this issue. kswapd0 has nothing to do with swap space or memory. kwapd0 is the kernel process which swaps tasks. A task is any thing that has a PID (which includes threads). When kswapd0 is high, it means the kernel is spending more time context switching tasks than it is actually executing the tasks.

I don't know what's causing the issue but you're chasing a ghost if you're trying to tune your swap/memory environment.

Jetto (remi-perrot) wrote :

I'm not sure I have the same issue as it occur only after resume.

I got a totally insane load average but no CPU load at all. One ore 2 minutes after resume my system become non responsible. I see the HD led continuously on but I don't know why.

Sometime, after 10mn the disk activity go down and I can use my system as usual. Sometime, I have to remote login with my smart-phone to shutdown and sometime I even can't shutdown and have to reset.

here is a top example :

top - 10:09:22 up 2 days, 1:02, 6 users, load average: 51.55, 33.77, 15.65
Tasks: 265 total, 1 running, 261 sleeping, 0 stopped, 3 zombie
Cpu(s): 22.0%us, 7.0%sy, 0.0%ni, 70.1%id, 0.9%wa, 0.1%hi, 0.0%si, 0.0%st
Mem: 4057104k total, 1464776k used, 2592328k free, 2660k buffers
Swap: 8388600k total, 1259212k used, 7129388k free, 74300k cached

  PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
15489 jetto 20 0 19352 1396 936 R 2 0.0 0:00.02 top
    1 root 20 0 23840 88 44 S 0 0.0 0:00.94 init
    2 root 20 0 0 0 0 S 0 0.0 0:00.01 kthreadd
    3 root RT 0 0 0 0 S 0 0.0 0:00.08 migration/0

Confiuration : Dist;Ubuntu 10.04 64bits CPU:Q6600 (quad core) Video:ATI Radeon HD 4750 ATI driver

Follow_Me (mails-valentin) wrote :

This issue is appear to be gone in 2.6.39.2

Changed in ubuntu:
status: New → Confirmed
Anthony Vito (anthony-vito) wrote :

On a 10.04 LTS machine running 2.6.32-32-generic SMP, 32 bit. I have a 80 gig intel SSD as the system drive and a 1 terabyte samsung as storage drive. It runs Windows XP VirtualBox instance all the time off the SSD. It runs ZoneMinder for 4 cameras and writes to the 1 terabyte drive. So it's always doing a lot of disk IO. With the 2.6.32-32 kernel I would experience high CPU for kswapd0, typically not 100% though, and load averages would get up to 7 and 8 when the Windows virtual machine was being actively used. The Windows virtual machine would often become unresponsive for several seconds at a time.

I updated this system to the 2.6.38-10 backport from PPA.

This completely resolved the issue with no other changes to the system. The load average rarely goes above 1.0, the system is very responsive no matter how much IO is going on, and I haven't seen kswapd0 in top since the upgrade.

User Unknown (user-unknown) wrote :

Yes, I also noticed that running a virtual machine in VirtualBox is almost guaranteed to start this issue immediately – apart from the sporadic occurrences when having the system with Firefox and Thunderbird run for several days and doing hibernate/resume over night.

Anthony, is this the PPA you are talking about?

https://launchpad.net/~canonical-kernel-team/+archive/ppa

I'd also like to give this a try, as this kswapd0/high IO load thingy has been a real bummer for many months now...

Thanks for the pointer. :-)

Anthony Vito (anthony-vito) wrote :

I used the command "sudo add-apt-repository ppa:kernel-ppa/ppa" to access the kernel packages. I believe this places the line "deb http://ppa.launchpad.net/kernel-ppa/ppa/ubuntu lucid main" in a sources list file, and adds the key. After running "sudo apt-get update" I could install the 2.6.38-10 packages with apt-get. Sorry if I'm explaining too much, it's the first time I've used a PPA.

I have also does this update to great success on two Studio 15 laptops. Those required a manual update of the "fglrx" kernel module for the new kernel. I installed the catalyst version 11-3 drivers that include this module without issue.

User Unknown (user-unknown) wrote :

Thanks @Follow-Me and @Anthony, the hint with the kernel update really seems to work. :-) I didn't know this was even possible in such an easy manner with an active 10.04 installation.

Inspired by Anthony's descriptions, I found out yesterday that even the Lucid-Updates repository[1] features 2.6.38-10-generic (even if this newer kernel is available, it won't get offered automatically to install by normal updates, it needs to be selected explicitly – or maybe 'dist-upgrade' would do, I didn't try that). So, for me, no PPA for the kernel was necessary.

I installed the following packages:

linux-headers-2.6.38-10 (2.6.38-10.46~lucid1)
linux-headers-2.6.38-10-generic (2.6.38-10.46~lucid1)
linux-image-2.6.38-10-generic (2.6.38-10.46~lucid1)

After installation and reboot into the new linux-image, I, too, had to fiddle around with my graphics drivers (NVidia) as the nvidia-current package wouldn't compile against 2.6.38. I had to add Ubuntu-X team's 'X Updates' PPA[2],[3], which provides version 275.19 of the NVidia drivers, to solve this problem for me.

To anyone else trying this: You might wanna add this PPA and upgrade your NVidia drivers *before* you boot with the linux-image-2.6.38. That might already compile the NVidia driver against 2.6.38, which could save you some low-res pain-in-the-eye after booting with 2.6.38. :-)

Anyway, everything runs fine so far. My usual suspects applications have been running ever since yesterday, I hibernated/resumed over night, and even did a test run of two VirtualBox VMs running at the same time. With the two VMs the system sure got a bit laggy from time to time, but it was usable all the time. IO Wait load occurred only for a few seconds every once in a while, with kswapd0 showing up as idle process every now and then (top -i) but disappearing shortly after and without any hassle.

Also, fullscreen flash video still works, so do fullscreen 3D games and, of course, my compiz effects. So, the NVidia driver appears to be fine. Also everything else, all other application I run thus far, worked as expected (I hope I won't hit rock buttom at some point, though...).

If everything should continue to run as it did ever since yesterday, this issue would finally be solved for me. :-) Oh, what a treat! Thank you again, guys!!

I hope this might help others affected.

Regards,
uu

[1]: [in Synaptic: menu 'Settings' ›] Software Sources › tab 'Updates' › check 'Recommended updates (lucid-updates)' and reload package index
[2]: https://launchpad.net/~ubuntu-x-swat/+archive/x-updates
[3]: Thanks go to 'BicyclerBoy' who suggested this PPA here: http://ubuntuforums.org/showthread.php?t=1691764

ScHRiLL (gorjan) wrote :

I can confirm. This also affects Ubuntu Linux 10.04.3 kernel: 2.6.32-34-server #77-Ubuntu SMP. The symptoms are the same.
When applications are using only swap the disk start working like crazy. Also everything that works on the machine slows down thereby. Even simple tasks like ls take 20 min. Not to mention every day work on the server, it's impossible to open any type of connection to it.

Although this bug is reported on LTS 10.04, I've to report that the bug still exists in kernel 3.1 (I'm on Debian though)! Even with swap turned off, the system still hangs as soon as there is insufficient memory. Stranger thing is, in iotop, it lists kswapd0 as having the most I/O% (i.e. highest disk activity among all processes), but both the read/write are 0 B/s!

Therefore I have a request to Arkadiy, and others: can you confirm that disabling swap like Graham did will solve the problem? I have tried both 'sudo swapoff -a' and 'sudo sysctl -w vm.swappiness=0' but it persists.

Arkadiy Kulev (eth-ethaniel) wrote :

Reply #21 (https://bugs.launchpad.net/ubuntu/+bug/721896/comments/21)

[quote]
I just thought I would shed some light on this issue. kswapd0 has nothing to do with swap space or memory. kwapd0 is the kernel process which swaps tasks. A task is any thing that has a PID (which includes threads). When kswapd0 is high, it means the kernel is spending more time context switching tasks than it is actually executing the tasks.

I don't know what's causing the issue but you're chasing a ghost if you're trying to tune your swap/memory environment.
[/quote]

I don't know what's causing the issue but you're chasing a ghost if you're trying to tune your swap/memory environment.

I don't think so - as I can see, when this happens to me, kernel copies (whats interesting it realy copies, not moving ) content of ram to swap ( without any reason, even when 20% of RAM is free ) untill swap is full.

I have 4G of RAM and 2G of swap

Shimi Chen (shimi-chen) wrote :

Set package to linux due to similarity with bug #484045 and red hat bug:
https://bugzilla.redhat.com/show_bug.cgi?id=712019

Not marking as duplicate due to kernel bugs policy

affects: ubuntu → linux (Ubuntu)
Changed in linux (Ubuntu):
importance: Undecided → Medium
Otus (jan-varho) wrote :

I'm seeing this on Precise with a computer that has weeks of uptime between reboots. 50% wa in top (one of two cores), 100% kswapd0 in iotop (no read of write throughput reported). This keeps happening with some 200-300 of MB free memory as reported by free -m (but significant swap use, so total used > physical memory).

Turning swaps off and on again usually helps. I can't try running without swap because there isn't enough memory to actually do much with the computer.

intuited (intuited) wrote :

A comment on the fedora bug (https://bugzilla.redhat.com/show_bug.cgi?id=712019) mentions that this occurs when a large file (>2G) is in cache. I just started experiencing this bug while working with large files, so this may be something to look into.

Arkadiy Kulev, thank you for taking the time to report this bug and helping to make Ubuntu better. Please execute the following command, as it will automatically gather debugging information, in a terminal:
apport-collect 721896
When reporting bugs in the future please use apport by using 'ubuntu-bug' and the name of the package affected. You can learn more about this functionality at https://wiki.ubuntu.com/ReportingBugs.

As well, could you please test the latest upstream kernel available following https://wiki.ubuntu.com/KernelMainlineBuilds ? It will allow additional upstream developers to examine the issue. Please do not test the kernel in the daily folder, but the one all the way at the bottom. Once you've tested the upstream kernel, please comment on which kernel version specifically you tested and remove the tag:
needs-upstream-testing

This can be done by clicking on the yellow pencil icon next to the tag located at the bottom of the bug description and deleting the text:
needs-upstream-testing

If this bug is fixed in the mainline kernel, please add the following tags:
kernel-fixed-upstream
kernel-fixed-upstream-VERSION-NUMBER

where VERSION-NUMBER is the version number of the kernel you tested.

If the mainline kernel does not fix this bug, please add the following tags:
kernel-bug-exists-upstream
kernel-bug-exists-upstream-VERSION-NUMBER

If you are unable to test the mainline kernel, please comment as to why specifically you were unable to test it and add the following tags:
kernel-unable-to-test-upstream
kernel-unable-to-test-upstream-VERSION-NUMBER

Please let us know your results. Thank you for your understanding.

tags: added: needs-kernel-logs needs-upstream-testing
affects: centos → linux
Changed in linux (Ubuntu):
status: Confirmed → Incomplete
Download full text (3.4 KiB)

I'm sorry Christopher, I downgraded to Debian Stable on my production
servers and not experiencing any more problems.

2012/10/17 Christopher M. Penalver <email address hidden>

> Arkadiy Kulev, thank you for taking the time to report this bug and
> helping to make Ubuntu better. Please execute the following command, as it
> will automatically gather debugging information, in a terminal:
> apport-collect 721896
> When reporting bugs in the future please use apport by using 'ubuntu-bug'
> and the name of the package affected. You can learn more about this
> functionality at https://wiki.ubuntu.com/ReportingBugs.
>
> As well, could you please test the latest upstream kernel available
> following https://wiki.ubuntu.com/KernelMainlineBuilds ? It will allow
> additional upstream developers to examine the issue. Please do not test the
> kernel in the daily folder, but the one all the way at the bottom. Once
> you've tested the upstream kernel, please comment on which kernel version
> specifically you tested and remove the tag:
> needs-upstream-testing
>
> This can be done by clicking on the yellow pencil icon next to the tag
> located at the bottom of the bug description and deleting the text:
> needs-upstream-testing
>
> If this bug is fixed in the mainline kernel, please add the following tags:
> kernel-fixed-upstream
> kernel-fixed-upstream-VERSION-NUMBER
>
> where VERSION-NUMBER is the version number of the kernel you tested.
>
> If the mainline kernel does not fix this bug, please add the following
> tags:
> kernel-bug-exists-upstream
> kernel-bug-exists-upstream-VERSION-NUMBER
>
> If you are unable to test the mainline kernel, please comment as to why
> specifically you were unable to test it and add the following tags:
> kernel-unable-to-test-upstream
> kernel-unable-to-test-upstream-VERSION-NUMBER
>
> Please let us know your results. Thank you for your understanding.
>
> ** Tags added: needs-kernel-logs needs-upstream-testing
>
> ** Attachment removed: "Output of 'top -i' in an interval of about 11
> seconds, showing kswapd0 idle process and high I/O Wait"
>
> https://bugs.launchpad.net/ubuntu/+source/linux/+bug/721896/+attachment/1872267/+files/top-monitor.txt
>
> ** Attachment removed: "[Log] Output of 'top -i' in an interval of about
> 11 seconds, showing kswapd0 idle process and high I/O Wait"
>
> https://bugs.launchpad.net/ubuntu/+source/linux/+bug/721896/+attachment/1872280/+files/top-monitor_lp-2011-02-26.log
>
> ** Package changed: centos => linux
>
> ** Changed in: linux (Ubuntu)
> Status: Confirmed => Incomplete
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/721896
>
> Title:
> kswapd0 100% cpu usage
>
> Status in The Linux Kernel:
> New
> Status in “linux” package in Ubuntu:
> Incomplete
>
> Bug description:
> After the running the latest ubuntu for at least 2 weeks, I've noticed
> that kswapd0 started using 100% CPU on one of my cores.
> However, I have enough of RAM and not using swap (Swap: 11876344k total,
> 62336k used).
>
> The only thing I can do to remove the problem is reboot the system.
> I'm using Ubuntu ...

Read more...

I think is on pack zramswap

josimar Amilcar, jafa, if you have a bug in Ubuntu, could you please file a new report by executing the following in a terminal:
ubuntu-bug linux

For more on this, please see the Ubuntu Kernel team article:
https://wiki.ubuntu.com/KernelTeam/KernelTeamBugPolicies#Filing_Kernel_Bug_reports

the Ubuntu Bug Control and Ubuntu Bug Squad article:
https://wiki.ubuntu.com/Bugs/BestPractices#X.2BAC8-Reporting.Focus_on_One_Issue

and Ubuntu Community article:
https://help.ubuntu.com/community/ReportingBugs#Bug_reporting_etiquette

When opening up the new report, please feel free to subscribe me to it.

Please note, not filing a new report may delay your problem being addressed as quickly as possible.

Thank you for your understanding.

dimovnike (dimovnike) wrote :

This happens pretty often on my system too (4Gb ram dual core, SSD) especially when running some java application together with thunderbird. (Anyway thunderbird slowness is another story..) but for example now i have the android emulator and android studio and as soon as I run thunderbird - the system goes very slow and barelyt responding to keypresses/mouse even the switching to VT1 works very slow. The top shows kswapd0 cpu usage to be 85-100% and the free ram is this:

             total used free shared buffers cached
Mem: 3920 3822 97 0 0 344
-/+ buffers/cache: 3477 442
Swap: 0 0 0

and this, is on raring! i remember this was happening on quantal and precise too ... please, if you need any tests done, let me know as this bugs renders this OS unusable for programming work. I am able to provide any logs u need.

dimovnike (dimovnike) wrote :

I forgot that my swap is disabled now, but this was happening with the swap on too, let me know if you need this checked...

dimovnike (dimovnike) wrote :

correction: enabling swap seems to fix this issue.

dimovnike, have you tried maxing out the swap usage then? For me, the problem occurs again if swap is also full.

dimovnike / Ahmad Syukri Abdollah, if you have a bug in Ubuntu, the Ubuntu Kernel team, Ubuntu Bug Control team, and Ubuntu Bug Squad would like you to please file a new report by executing the following in a terminal:
ubuntu-bug linux

For more on this, please see the Ubuntu Kernel team article:
https://wiki.ubuntu.com/KernelTeam/KernelTeamBugPolicies#Filing_Kernel_Bug_reports

the Ubuntu Bug Control team and Ubuntu Bug Squad team article:
https://wiki.ubuntu.com/Bugs/BestPractices#X.2BAC8-Reporting.Focus_on_One_Issue

and Ubuntu Community article:
https://help.ubuntu.com/community/ReportingBugs#Bug_reporting_etiquette

When opening up the new report, please feel free to subscribe me to it.

Please note, not filing a new report would delay your problem being addressed as quickly as possible.

Thank you for your understanding.

dimovnike (dimovnike) wrote :

I submitted a new report here https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1185172 also i subscribed you penalvch .

marco (nazgul17) wrote :

The problem is still affecting me. I have no swap partition but at some times computer starts lagging and disk start working as hell. top command tells me chromium and kswapd usage is very high.

marco, if you have a bug in Ubuntu, the Ubuntu Kernel team, Ubuntu Bug Control team, and Ubuntu Bug Squad would like you to please file a new report by executing the following in a terminal while booted into a Ubuntu repository kernel (not a mainline one) via:
ubuntu-bug linux

For more on this, please read the official Ubuntu documentation:
Ubuntu Bug Control and Ubuntu Bug Squad: https://wiki.ubuntu.com/Bugs/BestPractices#X.2BAC8-Reporting.Focus_on_One_Issue
Ubuntu Kernel Team: https://wiki.ubuntu.com/KernelTeam/KernelTeamBugPolicies#Filing_Kernel_Bug_reports
Ubuntu Community: https://help.ubuntu.com/community/ReportingBugs#Bug_reporting_etiquette

When opening up the new report, please feel free to subscribe me to it.

Please note, not filing a new report would delay your problem being addressed as quickly as possible.

No need exists to comment here at this time. After reading the above documentation in it's entirety, if you have further questions, you are welcome to redirect them to the appropriate mailing list or forum via http://www.ubuntu.com/support/community/mailinglists , or you may contact me directly.

Thank you for your understanding.

Thiago Martins (martinx) wrote :

Running fresh Ubuntu 13.10 on a new Macbook Air, I'm facing this problem.

My user home is encrypted, maybe it is related?! When I open too many sites with Firefox, kswapd0 goes "crazy", with Google Chrome, it does not happen that much.

BTW, this problem persist since middle of 2011 ???

Should I call Linus?! lol Kidding...

Best,
Thiago

Thiago Martins, if you have a bug in Ubuntu, the Ubuntu Kernel team, Ubuntu Bug Control team, and Ubuntu Bug Squad would like you to please file a new report by executing the following in a terminal while booted into a Ubuntu repository kernel (not a mainline one) via:
ubuntu-bug linux

For more on this, please read the official Ubuntu documentation:
Ubuntu Bug Control and Ubuntu Bug Squad: https://wiki.ubuntu.com/Bugs/BestPractices#X.2BAC8-Reporting.Focus_on_One_Issue
Ubuntu Kernel Team: https://wiki.ubuntu.com/KernelTeam/KernelTeamBugPolicies#Filing_Kernel_Bug_reports
Ubuntu Community: https://help.ubuntu.com/community/ReportingBugs#Bug_reporting_etiquette

When opening up the new report, please feel free to subscribe me to it.

Please note, not filing a new report would delay your problem being addressed as quickly as possible.

No need exists to comment here at this time. After reading the above documentation in it's entirety, if you have further questions, you are welcome to redirect them to the appropriate mailing list or forum via http://www.ubuntu.com/support/community/mailinglists , or you may contact me directly.

Thank you for your understanding.

Bachi (m-bachmann) wrote :

Since Ubuntu 13.10 update, I have high cpu loads which eventually (after 5-10sec) lead to a blocked system.
Same reason: kswapd0 uses lots of CPU. Also seems mostly in conjunction with Chrome when having many open tabs. Freeing memory by closing Chrome (or another heavy app) in time before the system becomes unresponsive helps, otherwise it crashes.

Freezes / crashes of this kind never happened before 13.10. though. Maybe the new zswap feature could play a role?

Bachi, thank you for your comment. So your hardware and problem may be tracked, could you please file a new report with Ubuntu by executing the following in a terminal while booted into a Ubuntu repository kernel (not a mainline one) via:
ubuntu-bug linux

For more on this, please read the official Ubuntu documentation:
Ubuntu Bug Control and Ubuntu Bug Squad: https://wiki.ubuntu.com/Bugs/BestPractices#X.2BAC8-Reporting.Focus_on_One_Issue
Ubuntu Kernel Team: https://wiki.ubuntu.com/KernelTeam/KernelTeamBugPolicies#Filing_Kernel_Bug_reports
Ubuntu Community: https://help.ubuntu.com/community/ReportingBugs#Bug_reporting_etiquette

When opening up the new report, please feel free to subscribe me to it.

Thank you for your understanding.

Helpful bug reporting tips:
https://wiki.ubuntu.com/ReportingBugs

Michael-tutty (michael-tutty) wrote :

I've been seeing this issue for almost a year now on an Asus Ultrabook (Core i5, 4GB RAM, SSD). I installed and ran 13.04 until two weeks ago, when I in-place upgraded to 13.10 (not a re-install). I've been seeing kswapd go crazy anywhere between weekly and daily, inevitably forcing a reboot every time.

Michael-tutty, thank you for your comment. So your hardware and problem may be tracked, could you please file a new report with Ubuntu by executing the following in a terminal while booted into a Ubuntu repository kernel (not a mainline one) via:
ubuntu-bug linux

For more on this, please read the official Ubuntu documentation:
Ubuntu Bug Control and Ubuntu Bug Squad: https://wiki.ubuntu.com/Bugs/BestPractices#X.2BAC8-Reporting.Focus_on_One_Issue
Ubuntu Kernel Team: https://wiki.ubuntu.com/KernelTeam/KernelTeamBugPolicies#Filing_Kernel_Bug_reports
Ubuntu Community: https://help.ubuntu.com/community/ReportingBugs#Bug_reporting_etiquette

When opening up the new report, please feel free to subscribe me to it.

Thank you for your understanding.

Helpful bug reporting tips:
https://wiki.ubuntu.com/ReportingBugs

no longer affects: linux (Ubuntu)
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in linux (Ubuntu):
status: New → Confirmed
affects: linux → linux (Ubuntu)
Changed in linux (Ubuntu):
status: New → Incomplete
importance: Undecided → Low
syadnom (dandenson) wrote :

same here running under hyper-v

my situation is as described above multiple times.

syadnom, thank you for your comment. So your hardware and problem may be tracked, could you please file a new report with Ubuntu by executing the following in a terminal while booted into a Ubuntu repository kernel (not a mainline one) via:
ubuntu-bug linux

For more on this, please read the official Ubuntu documentation:
Ubuntu Bug Control and Ubuntu Bug Squad: https://wiki.ubuntu.com/Bugs/BestPractices#X.2BAC8-Reporting.Focus_on_One_Issue
Ubuntu Kernel Team: https://wiki.ubuntu.com/KernelTeam/KernelTeamBugPolicies#Filing_Kernel_Bug_reports
Ubuntu Community: https://help.ubuntu.com/community/ReportingBugs#Bug_reporting_etiquette

When opening up the new report, please feel free to subscribe me to it.

Thank you for your understanding.

Helpful bug reporting tips:
https://wiki.ubuntu.com/ReportingBugs

János Milus (jmilus) wrote :

Same here.

Ubuntu 14.04, kernel 3.13.0-24-generic , HP ProLiant MicroServer , AMD Athlon(tm) II Neo N36L processor, 8G RAM
I use it as a media server, so it handle large (1+ G) files. kswapd0 uses 100% CPU after 5-6 days.

János Milus, thank you for your comment. So your hardware and problem may be tracked, could you please file a new report with Ubuntu by executing the following in a terminal while booted into a Ubuntu repository kernel (not a mainline one) via:
ubuntu-bug linux

For more on this, please read the official Ubuntu documentation:
Ubuntu Bug Control and Ubuntu Bug Squad: https://wiki.ubuntu.com/Bugs/BestPractices#X.2BAC8-Reporting.Focus_on_One_Issue
Ubuntu Kernel Team: https://wiki.ubuntu.com/KernelTeam/KernelTeamBugPolicies#Filing_Kernel_Bug_reports
Ubuntu Community: https://help.ubuntu.com/community/ReportingBugs#Bug_reporting_etiquette

When opening up the new report, please feel free to subscribe me to it.

Thank you for your understanding.

Helpful bug reporting tips:
https://wiki.ubuntu.com/ReportingBugs

Matthew Marinovich (c-matthew) wrote :

Hi there, I have the same problem (as described above) on Ubuntu 14.04 LTS running on Rackspace cloud servers.

Matthew Marinovich, thank you for your comment. So your hardware and problem may be tracked, could you please file a new report with Ubuntu by executing the following in a terminal while booted into the default Ubuntu kernel (not a mainline one) via:
ubuntu-bug linux

For more on this, please read the official Ubuntu documentation:
Ubuntu Bug Control and Ubuntu Bug Squad: https://wiki.ubuntu.com/Bugs/BestPractices#X.2BAC8-Reporting.Focus_on_One_Issue
Ubuntu Kernel Team: https://wiki.ubuntu.com/KernelTeam/KernelTeamBugPolicies#Filing_Kernel_Bug_reports
Ubuntu Community: https://help.ubuntu.com/community/ReportingBugs#Bug_reporting_etiquette

When opening up the new report, please feel free to subscribe me to it.

Thank you for your understanding.

Helpful bug reporting tips:
https://wiki.ubuntu.com/ReportingBugs

Stanislaw Halik (sthalik-k) wrote :

% grep /proc/[0-9]*/comm
% cat $(dirname $(grep kswapd /proc/[0-9]*/comm))/wchan; echo

Do this when irrational CPU usage occurs. Show wchan. If contention_wait, there's a fix. Anyway wchan is helpful.

Tim Carr (xaphod) wrote :

I see this on Ubuntu 14.04, kernel 3.14.1-031401-generic #201404141220 ... kswapd0 decides to eat 100% CPU for up to 20 min at a time, for no reason that I can see
Why is this bug Low importance? It's important to me that my CPU isn't unavailable due to a bug!
Hardware: ASUS CHROMEBOX-M004U Desktop PC Celeron 2955U (1.4GHz) - Haswell CPU

Tim Carr, thank you for your comment. Unfortunately, this bug report is not scoped to you, or your problem. So your hardware and problem may be tracked, could you please file a new report with Ubuntu by executing the following in a terminal while booted into the default Ubuntu kernel (not a mainline one) via:
ubuntu-bug linux

For more on this, please read the official Ubuntu documentation:
Ubuntu Bug Control and Ubuntu Bug Squad: https://wiki.ubuntu.com/Bugs/BestPractices#X.2BAC8-Reporting.Focus_on_One_Issue
Ubuntu Kernel Team: https://wiki.ubuntu.com/KernelTeam/KernelTeamBugPolicies#Filing_Kernel_Bug_reports
Ubuntu Community: https://help.ubuntu.com/community/ReportingBugs#Bug_reporting_etiquette

When opening up the new report, please feel free to subscribe me to it.

As well, please do not announce in this report you created a new bug report.

Thank you for your understanding.

Helpful bug reporting tips:
https://wiki.ubuntu.com/ReportingBugs

Solution checked in Ubuntu 14.04.1

Use vm.swappiness & vm.vfs_cache_pressure to the minimum possible
Run the below command in Terminal
sudo gedit /etc/sysctl.conf

Add the below line at the end of the file. Select File > Save. Select File > Quit. Restart computer
vm.swappiness=1
vm.vfs_cache_pressure=1

Note:
This can be a workaround, if top command shows kswapd0 taking 99% or 100% cpu, while heavy memory activity
Heavy memory activity may be playing Dota2, copying large files, browsing faulty websites, etc...
Suggested swap partition size in Ubuntu 14.04 64bit with heavy memory activity
Atleast double the size of RAM or 20GB whichever is bigger
Use bigger swap partition than the current, if the above issue still persists
Example swap entry in /etc/fstab to enable swap manually in /dev/sda7
/dev/sda7 none swap sw 0 0

https://sites.google.com/site/unityindiversity99/

Saravanan S PAJANCOA, thank you for your comment. So your problem and hardware may be tracked, could you please file a new report with Ubuntu by executing the following in a terminal while booted into the default Ubuntu kernel (not a mainline one) via:
ubuntu-bug linux

For more on this, please read the official Ubuntu documentation:
Ubuntu Bug Control and Ubuntu Bug Squad: https://wiki.ubuntu.com/Bugs/BestPractices#X.2BAC8-Reporting.Focus_on_One_Issue
Ubuntu Kernel Team: https://wiki.ubuntu.com/KernelTeam/KernelTeamBugPolicies#Filing_Kernel_Bug_reports
https://wiki.ubuntu.com/Kernel/Policies/DuplicateBugs
Ubuntu Community: https://help.ubuntu.com/community/ReportingBugs#Bug_reporting_etiquette

When opening up the new report, please feel free to subscribe me to it.

As well, please do not announce in this report you created a new bug report.

Thank you for your understanding.

Helpful bug reporting tips:
https://wiki.ubuntu.com/ReportingBugs

dino99 (9d9) wrote :

This version is now outdated and no more supported

Changed in linux (Ubuntu):
status: Incomplete → Invalid
David Miller (davidk001) wrote :

Ubuntu is customizable from the moment you install it. The latest version uses the GNOME desktop environment which allows you to personalize virtually every single element of your UI/UX, from your notification sounds, popup style, fonts, system animations, and workspaces. https://www.asussupportnumber.com/asus-customer-support/

Brad Figg (brad-figg) on 2019-07-24
tags: added: cscc
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.