LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 07-04-2010, 02:09 AM   #1
DebianUser
Member
 
Registered: Apr 2010
Posts: 88

Rep: Reputation: 15
kswapd High CPU Usage


Noticed my new build box was running slow and found kswapd is eating lots of cpu, any ideas on how I can resolve this?

Tasks: 5007 total, 3 running, 67 sleeping, 4937 stopped, 0 zombie
Cpu(s): 1.5%us, 50.7%sy, 0.0%ni, 45.9%id, 1.8%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 2042856k total, 1996780k used, 46076k free, 11368k buffers
Swap: 5269304k total, 15312k used, 5253992k free, 45876k cached

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
160 root 15 -5 0 0 0 R 96 0.0 6:23.58 kswapd0

oh just noticed has 5007 tasks in total, surely this can't be right????

Last edited by DebianUser; 07-04-2010 at 02:10 AM.
 
Old 07-04-2010, 02:51 AM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,120

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
That (kswapd) is a symptom, not a problem per se.
All them stopped tasks eating all the memory is (probably) the problem.
 
Old 07-04-2010, 06:59 AM   #3
DebianUser
Member
 
Registered: Apr 2010
Posts: 88

Original Poster
Rep: Reputation: 15
After a reboot top shows....

top - 12:39:02 up 0 min, 1 user, load average: 0.71, 0.23, 0.08
Tasks: 69 total, 1 running, 68 sleeping, 0 stopped, 0 zombie
Cpu(s): 0.0%us, 0.2%sy, 0.0%ni, 99.0%id, 0.7%wa, 0.0%hi, 0.2%si, 0.0%st
Mem: 2042856k total, 108792k used, 1934064k free, 6064k buffers
Swap: 5269304k total, 0k used, 5269304k free, 53700k cached

however when I ran eject /dev/hda it shot back up to

Tasks: 4599 total, 5 running, 4594 sleeping, 0 stopped, 0 zombie
Cpu(s): 1.5%us, 96.7%sy, 0.0%ni, 0.3%id, 1.5%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 2042856k total, 1995620k used, 47236k free, 1952k buffers
Swap: 5269304k total, 632k used, 5268672k free, 27728k cached

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
160 root 15 -5 0 0 0 R 92 0.0 2:20.70 kswapd0
7182 root 20 0 9596 6152 428 S 46 0.3 0:10.40 bash
7181 root 20 0 9592 6148 428 S 25 0.3 0:10.70 bash
7187 root 20 0 9596 5916 192 R 25 0.3 0:00.84 bash

and the command hung

when I topped again (with eject still running) a couple of minutes later it showed

top - 13:03:50 up 8 min, 2 users, load average: 2.78, 2.28, 1.13
Tasks: 4770 total, 5 running, 4765 sleeping, 0 stopped, 0 zombie
Cpu(s): 1.5%us, 98.5%sy, 0.0%ni, 0.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 2042856k total, 1994812k used, 48044k free, 400k buffers
Swap: 5269304k total, 174456k used, 5094848k free, 11520k cached

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
160 root 15 -5 0 0 0 R 99 0.0 6:41.72 kswapd0

Eject used to work fine?

update, now when I try to mount the drive I get

mount /dev/hda -t iso9660 -r /mnt/cdrom
mount: wrong fs type, bad option, bad superblock on /dev/hda,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try

dmesg

[ 169.268283] hda: rw=0, want=68, limit=4
[ 169.268283] isofs_fill_super: bread failed, dev=hda, iso_blknum=16, block=16

Last edited by DebianUser; 07-04-2010 at 07:15 AM.
 
Old 07-04-2010, 08:16 PM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,120

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
I'd be guessing you have a script (or alias maybe) for "eject" that's getting in the way. Try this to see what all those processes are
Code:
ps-eo comm | uniq -c | sort -nr | head -n 20
 
Old 08-03-2010, 09:54 AM   #5
DebianUser
Member
 
Registered: Apr 2010
Posts: 88

Original Poster
Rep: Reputation: 15
that command returns

5 getty
2 sshd
2 pdflush
1 watchdog/1
1 watchdog/0
1 vsftpd
1 usb-storage
1 uniq
1 udevd
1 sort
1 scsi_eh_2
1 scsi_eh_1
1 scsi_eh_0
1 rsyslogd
1 rpc.statd
1 ps
1 portmap
1 named
1 migration/1
1 migration/0
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
CPU usage too high! rock.k Linux - Newbie 4 03-01-2008 04:48 AM
High CPU Usage in OpenSuSE 10.2 swampdog2002 SUSE / openSUSE 2 01-20-2008 12:58 PM
High CPU usage ?! Why? skate Linux - Software 1 04-11-2007 05:55 AM
High Cpu usage untak Debian 21 01-23-2007 06:21 AM
cpu usage high corbintechboy VectorLinux 2 07-27-2005 08:11 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:48 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