LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 07-23-2016, 11:59 AM   #1
soxplayer
Member
 
Registered: Jul 2004
Posts: 50

Rep: Reputation: 20
kswapd0 at 100% CPU


Good Day,

My laptop has had terrible battery life since upgrading to Slackware 14.2 64 bit from 14.1/32.

According to top, kswapd0 is using 90-100% CPU, see below, any ideas on how to troubleshoot this condition?

Thanks.

<pre style='color:#1f1c1b;background-color:#ffffff;'>
top - 11:56:52 up 17:23, 2 users, load average: 1.58, 1.24, 1.12
Tasks: 175 total, 2 running, 173 sleeping, 0 stopped, 0 zombie
%Cpu(s): 12.3 us, 63.7 sy, 0.1 ni, 23.5 id, 0.1 wa, 0.0 hi, 0.4 si, 0.0 st
KiB Mem : 1671936 total, 477448 free, 515376 used, 679112 buff/cache
KiB Swap: 20971516 total, 20820224 free, 151292 used. 826740 avail Mem

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
47 root 20 0 0 0 0 R 94.1 0.0 213:39.49 kswapd0
1 root 20 0 4372 664 632 S 0.0 0.0 0:00.57 init
2 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kthreadd
3 root 20 0 0 0 0 S 0.0 0.0 0:00.45 ksoftirqd/0
5 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kworker/0:+
7 root 20 0 0 0 0 S 0.0 0.0 1:13.82 rcu_sched
8 root 20 0 0 0 0 S 0.0 0.0 0:00.00 rcu_bh
9 root rt 0 0 0 0 S 0.0 0.0 0:00.01 migration/0
10 root rt 0 0 0 0 S 0.0 0.0 0:00.01 migration/1
11 root 20 0 0 0 0 S 0.0 0.0 0:00.12 ksoftirqd/1
13 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kworker/1:+
14 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kdevtmpfs
15 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 netns
</pre>
 
Old 07-23-2016, 12:37 PM   #2
phenixia2003
Senior Member
 
Registered: May 2006
Location: France
Distribution: Slackware
Posts: 1,052

Rep: Reputation: 1008Reputation: 1008Reputation: 1008Reputation: 1008Reputation: 1008Reputation: 1008Reputation: 1008Reputation: 1008
Hello,

I found this thread and this kernel bug report about this issue.


As stated in this post you can try to workaround this by running the command below :
Code:
echo 3 > /proc/sys/vm/drop_caches
If this does not work, you can also try this workaround.

--
SeB
 
Old 07-23-2016, 05:18 PM   #3
zk1234
4MLinux Maintainer
 
Registered: Oct 2010
Location: Poland
Distribution: 4MLinux, Slackware
Posts: 1,256

Rep: Reputation: 220Reputation: 220Reputation: 220
Either you have no swap partition or it's not created/formatted correctly.
 
Old 07-23-2016, 05:43 PM   #4
soxplayer
Member
 
Registered: Jul 2004
Posts: 50

Original Poster
Rep: Reputation: 20
Checked formatting of swap

zk1234,

I tried:

swapoff /dev/sda2

mkswap /dev/sda2 with no errors and

swapon /dev/sda2

kswapd0 is still running full steam ahead.
 
Old 07-23-2016, 05:50 PM   #5
soxplayer
Member
 
Registered: Jul 2004
Posts: 50

Original Poster
Rep: Reputation: 20
echo 3 > is ineffective

phenixia2013,

The drop_caches setteing does not work. I will have to try the other cure next.

Just in case, here are the results of a free command after reformatting the swap partition:

total used free shared buff/cache available
Mem: 1671936 1176192 148088 253008 347656 79216
Swap: 20971516 0 20971516


and I am running the stock 64 bit kernel vmlinuz-generic-4.4.14 as shipped with slackware.
 
Old 07-23-2016, 08:57 PM   #6
soxplayer
Member
 
Registered: Jul 2004
Posts: 50

Original Poster
Rep: Reputation: 20
Attempted cure

After reading through the link about other workarounds, I decided to try passing "mem=1920M" as an argument to the kernel since I also have a laptop with 2048M of memory. So far this seems to be working.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
OpenOffice/LibreOffice writer uses 100% CPU time, 100% memory, workaround someone? jlinkels Linux - Software 11 08-30-2012 01:50 PM
kswapd0 eats 100% CPU, drives up system load ravindert Linux - Newbie 8 07-25-2012 08:49 PM
high memory and cpu usage when copying large amounts, KSWAPD0 ouigkmy Linux - General 5 08-02-2011 06:32 AM
ubuntu smp: why is kswapd0 taking 100% CPU time? eantoranz Linux - Software 0 10-18-2005 02:38 PM
kswapd0 hogs all cpu maenho Linux - Software 2 03-02-2005 08:36 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 09:20 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration