LinuxQuestions.org
Help answer threads with 0 replies.
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 01-22-2006, 07:58 PM   #1
Spikeles
LQ Newbie
 
Registered: Jan 2006
Location: Townsville, Australia
Distribution: Gentoo
Posts: 2

Rep: Reputation: 0
Post Wait States(70-80%) and the Linux Kernel


Hi all. I've got a small question.

What exactly are "wait states"?
When i run 'top' i get the following line:

Cpu(s): 4.9% us, 1.0% sy, 0.0% ni, 83.6% id, 9.8% wa, 0.3% hi, 0.3% si

Now, that's user, system, nice, idle, wait state, hardware interrupts and software interrupts. Right?

Now, it's my understanding that wait states is the amount of time spent waiting for I/O? Is this correct? eg. reading a bunch of data off the disk would cause the wait states to go up?

Well, whenever i do almost anything ( like emerge -uDp world (i have gentoo ), the wait states sit up at about 70-80%, sometimes even higher.

Is this normal? I already have used hdparm to tweak the hd settings. Are they any kernel options(such as ones in /proc) that can help improve this? Or should i consider setting up raid? The PC is used as a desktop and development machine.. not a server, and the disks are only EIDE, not SATA.

Thanks in advance for any help you can give.
 
Old 01-23-2006, 01:38 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Hi, and welcome to LQ!


What are the overall hardware specs, and what does the output of
your tweaked hdparm say?

Also, what throughput does hdparm -tT give you for the devices?


Cheers,
Tink
 
Old 01-23-2006, 04:07 PM   #3
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,671
Blog Entries: 4

Rep: Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945
Quote:
Originally Posted by Spikeles
What exactly are "wait states"?
When i run 'top' i get the following line:

Cpu(s): 4.9% us, 1.0% sy, 0.0% ni, 83.6% id, 9.8% wa, 0.3% hi, 0.3% si

Now, that's user, system, nice, idle, wait state, hardware interrupts and software interrupts. Right?
For an explanation of the columns, see man vmstat:
Code:
These are percentages of total CPU time.
us: Time spent running non-kernel code. (user time, including nice time)
sy: Time spent running kernel code. (system time)
id: Time spent idle. Prior to Linux 2.5.41, this includes IO-wait time.
wa: Time spent waiting for IO. Prior to Linux 2.5.41, shown as zero.
("nice time" is time spent running tasks that were voluntarily scheduled at a reduced priority through the nice command.)
It is perfectly normal for the CPU to spend most of its time "waiting," even when the system is busy as a beaver -- because the CPU is, well, so damned fast.

What you really should be looking for is process wait-states: the things that are causing a particular running program to be delayed involuntarily. Again it is quite normal for processes to do more I/O than anything else, and so to spend most of their time "waiting for I/O." If they are in a swap wait, however, they're being delayed against their will, because of memory constraints.
 
Old 01-23-2006, 06:41 PM   #4
Spikeles
LQ Newbie
 
Registered: Jan 2006
Location: Townsville, Australia
Distribution: Gentoo
Posts: 2

Original Poster
Rep: Reputation: 0
sundialsvcs:
Well. I would have thought that the computer would spend most of it's time in idle. It's my understanding that while waiting the cpu is blocked g (eg. a synchronized call ), it's not doing anything else.
Quote:
the things that are causing a particular running program to be delayed involuntarily
How then can i find where the bottle neck is to reduce the amount of time processes are waiting? I will say that i almost never swap any memory at all, it's a desktop PC with 1gig memory, so swapping is not an issue. That's why i was asking if upgrading to SATA would reduce the amount of time spent waiting if it's a harddrive bottleneck. I realize the CPU is faster than the seek time of the hard disks, so can i tweak some buffer settings in the kernel or something to help reduce the time spent accessing the disks?

Quote:
What are the overall hardware specs, and what does the output of
your tweaked hdparm say?
Also, what throughput does hdparm -tT give you for the devices?
hdb is the only drive worth mentioning, hda is my windows drive and it's put into sleep state at boot.

/dev/hdb:
Timing cached reads: 1488 MB in 2.00 seconds = 743.74 MB/sec
Timing buffered disk reads: 150 MB in 3.04 seconds = 49.33 MB/sec

Here's the info on hdb
/dev/hdb:
multcount = 16 (on)
IO_support = 3 (32-bit w/sync)
unmaskirq = 1 (on)
using_dma = 1 (on)
keepsettings = 0 (off)
readonly = 0 (off)
readahead = 256 (on)
geometry = 65535/16/63, sectors = 80026361856, start = 0

Model=WDC WD800JB-00JJA0, FwRev=05.01C05, SerialNo=WD-WCAM91538029
Config={ HardSect NotMFM HdSw>15uSec SpinMotCtl Fixed DTR>5Mbs FmtGapReq }
RawCHS=16383/16/63, TrkSize=0, SectSize=0, ECCbytes=66
BuffType=unknown, BuffSize=8192kB, MaxMultSect=16, MultSect=16
CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=156301488
IORDY=on/off, tPIO={min:120,w/IORDY:120}, tDMA={min:120,rec:120}
PIO modes: pio0 pio3 pio4
DMA modes: mdma0 mdma1 mdma2
UDMA modes: udma0 udma1 udma2 udma3 udma4 *udma5
AdvancedPM=no WriteCache=enabled
Drive conforms to: device does not report version:

As for overall specs:

P4 2.4(no HT)
1 gig mem(er DDRRAM, just can't remember exact speed)
ASUS P4s533MX motherboard
SIS Chipset

-lspci output
00:00.0 Host bridge: Silicon Integrated Systems [SiS] 651 Host (rev 02)
00:01.0 PCI bridge: Silicon Integrated Systems [SiS] Virtual PCI-to-PCI bridge (AGP)
00:02.0 ISA bridge: Silicon Integrated Systems [SiS] SiS962 [MuTIOL Media IO] (rev 25)
00:02.1 SMBus: Silicon Integrated Systems [SiS] SiS961/2 SMBus Controller
00:02.5 IDE interface: Silicon Integrated Systems [SiS] 5513 [IDE]
00:03.0 USB Controller: Silicon Integrated Systems [SiS] USB 1.0 Controller (rev 0f)
00:03.1 USB Controller: Silicon Integrated Systems [SiS] USB 1.0 Controller (rev 0f)
00:03.3 USB Controller: Silicon Integrated Systems [SiS] USB 2.0 Controller
00:04.0 Ethernet controller: Silicon Integrated Systems [SiS] SiS900 PCI Fast Ethernet (rev 91)
00:10.0 Multimedia audio controller: Creative Labs SB0400 Audigy2 Value
01:00.0 VGA compatible controller: nVidia Corporation NV34 [GeForce FX 5500] (rev a1)


Also, just for some extra info, here's some output from 'dstat' while an updatedb was in progress.
Code:
-------cpu0-usage------ --disk/hda----disk/hdb- --net/eth0- ---paging-- ---system--
usr sys idl wai hiq siq|_read write:_read write|_recv _send|__in_ _out_|_int_ _csw_
 13   6  36  44   1   0| 165B    0 : 961k  135k|   0     0 |   0     0 |1555  1544
  4  46   0  48   3   0|   0     0 :1817k    0 |   0     0 |   0     0 |4819  7815
  4  51   0  43   2   0|   0     0 : 917k    0 | 180B    0 |   0     0 |2960  4332
  4  20   0  75   1   1|   0     0 : 974k   20k|   0     0 |   0     0 |3052  4443
  4  21   0  73   2   0|   0     0 :1410k    0 |   0     0 |   0     0 |3952  6209
  2  22   0  75   1   0|   0     0 :1540k  148k| 243B    0 |   0     0 |3199  4665
  4   2   0  94   0   0|   0     0 : 872k   52k|   0     0 |   0     0 |1336  1009
  3   2   0  94   1   0|   0     0 :1148k    0 |   0     0 |   0     0 |1404  1169
  4   3   0  92   1   0|   0     0 :1156k    0 | 132B  253B|   0     0 |1405  1223
  3   1   0  96   0   0|   0     0 :1108k    0 |   0     0 |   0     0 |1379  1157
  7   4   0  88   1   0|   0     0 :1224k   72k|   0     0 |   0     0 |1712  1477

Last edited by Spikeles; 01-23-2006 at 06:42 PM.
 
  


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
should I? kernel 2.4 or 2.6? or wait for Slackware 11?? towsonu2003 Slackware 15 09-21-2005 11:36 PM
Wait a sec... JDS -- it's not just on Linux. slackMeUp JDS 2 12-30-2004 05:39 PM
updatign nv drivers states need precompiles kernel src i have src and headers no joy gonus Debian 6 10-31-2004 10:21 AM
How many head of the states support linux? arunshivanandan General 4 08-02-2003 06:34 AM
Ahhh Linux Finally Werks Oh No Wait a Minute!!! Insanepyro69 Linux - Newbie 3 11-27-2001 10:06 AM

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

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