kswapd0 using 100% CPU with not even a MB swap in use

246 views
Skip to first unread message

Holger Levsen

unread,
Oct 7, 2017, 7:21:12 PM10/7/17
to qubes...@googlegroups.com
Hi,

so kswapd0 is using 100% CPU in one of my Qubes and this makes the fan spin
and noisy… and that Qube is hardly using any swap at all:

$ free
total used free shared buff/cache available
Mem: 1888212 776484 640712 70296 471016 1031616
Swap: 1048572 716 1047856

So I ran "sudo swapoff -a" (and "sudo swapon -a") and now zero swap is used but
kswapd0 is still busy swapping(?) and the fan is noisy and I wonder what to do…

Any hints / ideas?

(I know I could shut down the VM and restart it but I hope there's a better
solution / workaround.)


--
cheers,
Holger
signature.asc

Marek Marczykowski-Górecki

unread,
Oct 8, 2017, 8:18:15 AM10/8/17
to qubes...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

On Sat, Oct 07, 2017 at 10:29:11AM +0000, Holger Levsen wrote:
> Hi,
>
> so kswapd0 is using 100% CPU in one of my Qubes and this makes the fan spin
> and noisy… and that Qube is hardly using any swap at all:
>
> $ free
> total used free shared buff/cache available
> Mem: 1888212 776484 640712 70296 471016 1031616
> Swap: 1048572 716 1047856
>
> So I ran "sudo swapoff -a" (and "sudo swapon -a") and now zero swap is used but
> kswapd0 is still busy swapping(?) and the fan is noisy and I wonder what to do…
>
> Any hints / ideas?

I've seen this some time ago and `echo 3 > /proc/sys/vm/drop_caches`
helped. No idea why it is spinning...

- --
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQEcBAEBCAAGBQJZ2heAAAoJENuP0xzK19cs7KsH/1kTlCNMxHSnCqI42UoWxuRE
KdhTOx8XFZEWakifL+fUS4F3ofaREpZtnSm9tTtSzhOnRJN+KJYZAk1+MfCaXOBA
cEuVcu1l/1gNyZtzsVoZNbMleQCzPQXmXw9rbDMbACSWuvtRIVWJF9rDPq2VJOCJ
c9PrlgvlFk2/YzOjtHbuDig5nRNX+PSgOMcIHeNd7phz9r+XzwNSpwdlq4xse0ta
WM+EpPlUylt5iuFOcrx3Nuf43hL7fbp6GTgIKKOx7sO7++c6Eu34NJRgqJvWbrAn
rA4HnYUSDFogzVZvVlOatdxo6idi6xdVUw17DcLpcuFRI/5A9fgAhGn/ZRw4kzU=
=zt6J
-----END PGP SIGNATURE-----

Chris Laprise

unread,
Oct 8, 2017, 1:35:02 PM10/8/17
to Marek Marczykowski-Górecki, qubes...@googlegroups.com
On 10/08/2017 08:18 AM, Marek Marczykowski-Górecki wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
> On Sat, Oct 07, 2017 at 10:29:11AM +0000, Holger Levsen wrote:
>> Hi,
>>
>> so kswapd0 is using 100% CPU in one of my Qubes and this makes the fan spin
>> and noisy… and that Qube is hardly using any swap at all:
>>
>> $ free
>> total used free shared buff/cache available
>> Mem: 1888212 776484 640712 70296 471016 1031616
>> Swap: 1048572 716 1047856
>>
>> So I ran "sudo swapoff -a" (and "sudo swapon -a") and now zero swap is used but
>> kswapd0 is still busy swapping(?) and the fan is noisy and I wonder what to do…
>>
>> Any hints / ideas?
> I've seen this some time ago and `echo 3 > /proc/sys/vm/drop_caches`
> helped. No idea why it is spinning...
>

What VM kernel are you using? I saw a great reduction in this problem
when I upgraded to the latest 4.9 kernels; currently using 4.9.45-21 and
the problem isn't reappearing.

--

Chris Laprise, tas...@posteo.net
https://twitter.com/ttaskett
PGP: BEE2 20C5 356E 764A 73EB 4AB3 1DC4 D106 F07F 1886

Marek Marczykowski-Górecki

unread,
Oct 8, 2017, 1:46:07 PM10/8/17
to Chris Laprise, qubes...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

On Sun, Oct 08, 2017 at 01:34:56PM -0400, Chris Laprise wrote:
> On 10/08/2017 08:18 AM, Marek Marczykowski-Górecki wrote:
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA256
> >
> > On Sat, Oct 07, 2017 at 10:29:11AM +0000, Holger Levsen wrote:
> > > Hi,
> > >
> > > so kswapd0 is using 100% CPU in one of my Qubes and this makes the fan spin
> > > and noisy… and that Qube is hardly using any swap at all:
> > >
> > > $ free
> > > total used free shared buff/cache available
> > > Mem: 1888212 776484 640712 70296 471016 1031616
> > > Swap: 1048572 716 1047856
> > >
> > > So I ran "sudo swapoff -a" (and "sudo swapon -a") and now zero swap is used but
> > > kswapd0 is still busy swapping(?) and the fan is noisy and I wonder what to do…
> > >
> > > Any hints / ideas?
> > I've seen this some time ago and `echo 3 > /proc/sys/vm/drop_caches`
> > helped. No idea why it is spinning...
> >
>
> What VM kernel are you using? I saw a great reduction in this problem when I
> upgraded to the latest 4.9 kernels; currently using 4.9.45-21 and the
> problem isn't reappearing.

Indeed on 4.9.45-21 kernel it happens much rarer than on 4.4.x, but still
happens sometimes...

- --
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQEcBAEBCAAGBQJZ2mRZAAoJENuP0xzK19cshFsH+QHtxSPUahVkmYLUcbgfmNzm
BQTqvCU3SaWb+C51zze8oC3FDq+Wrw+yi/1QmkR7mt+s90nk1LJQtUDVsJhgcHKF
KBAS3DsicaWXvPpbC6YPHsnNRzxsWWnbhE7StVjdb3zcu5scIBmQ1KTSBk1WbEWX
rIbxIkQgzyUW6GSmwxpslxtUb9W3jl7OlwShtXQOKZiQ8m0w75WboYSG7wVsHwjo
AiA5Tkn2aqdP8JWJsPi9GIIaBWKIMUEfrq5+pvvrkSb+Ik8E2jkZ8GKlXcBxAo7f
BB7diYeavtvcZVvEsX8lIhCZMwxCITm71+nMUtdQlW8AdcLIcdRSOyhWUf+mRLI=
=vlux
-----END PGP SIGNATURE-----

Ron Hunter-Duvar

unread,
Oct 8, 2017, 8:40:54 PM10/8/17
to qubes...@googlegroups.com
Two questions:
1. What's that Qube doing?
2. What's it's max memory?

Just speculating, but if a Qube hits the max memory it's allowed by the
dom0, would it start swapping, even if there was lots of memory
available on the machine?

Ron

Holger Levsen

unread,
Oct 9, 2017, 5:02:53 AM10/9/17
to qubes...@googlegroups.com
Hi,

so, that Qube was idling and well below it's max memory usage…

On Sun, Oct 08, 2017 at 07:45:58PM +0200, Marek Marczykowski-Górecki wrote:
> > > I've seen this some time ago and `echo 3 > /proc/sys/vm/drop_caches`
> > > helped. No idea why it is spinning...

thanks, Marek. I'll try this the next time this is happening…

> > What VM kernel are you using? I saw a great reduction in this problem when I
> > upgraded to the latest 4.9 kernels; currently using 4.9.45-21 and the
> > problem isn't reappearing.
> Indeed on 4.9.45-21 kernel it happens much rarer than on 4.4.x, but still
> happens sometimes...

yeah, I think I can confirm this. (I'm definitly on 4.9.45-21 now :)


--
cheers,
Holger
signature.asc

Vincent Adultman

unread,
Oct 10, 2017, 12:08:41 PM10/10/17
to qubes...@googlegroups.com

> On 10/08/2017 08:18 AM, Marek Marczykowski-Górecki wrote:

Indeed on 4.9.45-21 kernel it happens much rarer than on 4.4.x, but still
happens sometimes...

It's only anecdotal, but I seem to have been seeing it more frequently recently (i.e. on that kernel). Will try the one-liner again, don't think it had any effect last time I tried it. I've got at least one old laptop with probably poor thermal paste or a dust bunny that this actually causes to overheat and shut down in a warm room. Less critically, for what's often a laptop OS it's rather hard on the battery.

FWIW (beware, anecdote incoming) the problem does seem different under the newer kernel, in that close enough other vms and the one with the problem may settle down (which I don't remember happening before). However, this makes limited sense to me, given that one vm that does it (sys-net) is not included in memory balancing, whereas others that randomly do it are. The vms that do it are fedora service vms, through to debian ones running chromium, the commonality being the kernel.

A quick google suggests this occurs / or has occurred on a variety of linux distros, but I do wonder if something about a memory constrained qubes install makes it more likely.

Marak, afaik there is no bug open for this, would it be worth me opening one, even if its just to track and add to a known issues page or similar? Seems enough of us run into this one.

Holger Levsen

unread,
Oct 11, 2017, 12:41:05 PM10/11/17
to qubes...@googlegroups.com
On Sun, Oct 08, 2017 at 02:18:06PM +0200, Marek Marczykowski-Górecki wrote:
> I've seen this some time ago and `echo 3 > /proc/sys/vm/drop_caches`
> helped. No idea why it is spinning...

I decided to better use 'echo 3 | sudo tee /proc/sys/vm/drop_caches' and that
that worked nicely indeed, I got silence again. So thanks again! :)


--
cheers,
Holger
signature.asc
Reply all
Reply to author
Forward
0 new messages