kswapd pegging cpu

Bug #1496051 reported by kevin gunn
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Canonical System Image
Incomplete
Undecided
Unassigned
lxc-android-config (Ubuntu)
Expired
Medium
Unassigned

Bug Description

while debugging bug 1491566
On arale, rc-proposed circa sept 14
I had launched phone, messaging, browser (on cnn.com), camera (taken pics), gallery (edit mode of pic), clock, ubuntu-system-settings, cut-the-rope, dash (of course) - toggling between them in the spread, just selecting them, mostly clock, browser, gallery
and at the same time running the phone/text script as found in bug 1491566 (modified to text, call, then text 5 times)

I just happened to be running top and then noticed process
kswapd
would run & peg cpu intermittently, sometimes it would peg the cpu for just 1 second or so, but then sometimes it would appear to run at 95%+ for like 10 seconds or more.
It didn't seem to follow a particular pattern, but i could definitely tell it was effecting the ui (stalling)

ogra indicated our swappiness should be very low.
so i did sudo sysctl vm.swappiness=10 as instructed, however as i continued testing, i continued to see kswapd continue to run and peg the cpu at about the same frequency.

tags: added: hotfix
Changed in canonical-devices-system-image:
assignee: nobody → John McAleely (john.mcaleely)
importance: Undecided → Critical
milestone: none → ww40-2015
status: New → Confirmed
Revision history for this message
kevin gunn (kgunn72) wrote :

just adding, i'm not an anomaly jibel indicates he sees this quite regularly in testing

Changed in lxc-android-config (Ubuntu):
importance: Undecided → Critical
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in lxc-android-config (Ubuntu):
status: New → Confirmed
Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

I think kswapd is a necessary evil and the system can hardly be prevented of swapping pages in and out. kswapd activity is generally a symptom of another problem.

I noticed that when kswapd runs for several seconds, it generates lot of IO and slows down the system drastically. It can be reproduced with dd and creating large files. The system slow down due IO load is also observed when apport writes a crash report. Is there a way to tune the filesystem and improve disk access?

Secondly, when the system swaps heavily it means that some process is using lot of memory. I looked at the memory consumption and reported bug 1497924 for the memory usage of oxide and apps depending on it (webbrowser and webapps) Fixing it might improve the situation of memory consumption and reduce the activity of kswapd.

Finally, setting swappiness to 1 *seems* to improve the situation a little bit but it's just an impression and I don't have numbers to prove if it's better one way or the other. Certainly the default of 100 has a negative impact on performance.

Changed in canonical-devices-system-image:
milestone: ww40-2015 → backlog
Revision history for this message
Pat McGowan (pat-mcgowan) wrote :

Not sure what to do with this

Changed in canonical-devices-system-image:
importance: Critical → Undecided
status: Confirmed → Incomplete
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

I suppose we might consider discussing changing the default vm.swappiness value to something smaller, but I guess someone would have to do some testing and comparison so we have actual numbers on how it affects system performance. Not sure if I would consider it a hotfix for OTA-8.5 though, not enough research done on this.

tags: removed: hotfix
Changed in canonical-devices-system-image:
assignee: John McAleely (john.mcaleely) → nobody
kevin gunn (kgunn72)
Changed in lxc-android-config (Ubuntu):
status: Confirmed → Incomplete
importance: Critical → Medium
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for lxc-android-config (Ubuntu) because there has been no activity for 60 days.]

Changed in lxc-android-config (Ubuntu):
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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