The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
Google UNIX.COM


UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
HP Tru64 NFS help Stin HP-UX 1 05-13-2008 10:44 AM
Tru64-unix adak2010 UNIX for Dummies Questions & Answers 0 03-17-2008 07:46 AM
HP-UX and Tru64 antani HP-UX 1 08-04-2007 04:24 PM
Top in Tru64 fidodido UNIX for Dummies Questions & Answers 3 05-17-2006 08:28 AM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-06-2007
Registered User
 

Join Date: Sep 2006
Posts: 14
ps report (on tru64)

hi,
i have 10 processes running on a tru64
machine with 16 cpu. when i am checking the states of these processes
with ps command, i saw that almost never more than 3 of them are in the
R(unning) state. (generally they are in the S(leeping) state).

although there are many other processes running on the same machine,
my expectation is to see most of my processes in the running state,
because top reports generally we have 20%-50% idle cpu,

even if they are waiting for some resource (e.g: io), they should be
in U(ninterruptable) state, am i wrong?

how can this sleeping state problem can be explained?
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 03-06-2007
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,334
If a process is waiting for a resource it will almost always be asleep and will be woken by the kernel when the resource is available. CPU's do not simply run processes...it might be running kernel code to make those needed resources available. An idle CPU is looping repeatedly scanning the run queue looking for something to do... no other state is counted as idle.

The exception to sleeping for a resource is spinlocking...just looping until the resource is free (because the resource is expected to be locked very briefly). This happens in the kernel in an SMP environment. 16 cpus is a lot and you probably spend a fair amount of time spinlocked. Spinlocking if why you can't have unlimited numbers of cpu's on an SMP box...you reach a point where you spinlock too much.
Reply With Quote
  #3 (permalink)  
Old 03-07-2007
Registered User
 

Join Date: Sep 2006
Posts: 14
S(leeping) state means that process is waiting for a resource.
then, is it possible to determine what is that resource?
process is waiting for what?
using lsof, iostat,netstat,vmstat or something else on tru64?

thanks in advance
Reply With Quote
  #4 (permalink)  
Old 03-07-2007
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,334
Well, I have never used Tru64, so I'm not sure how hard that will be. But at some level the answer is yes, it is possible. A sleeping process will have a value usually called a "wait channel" that relates to what it is waiting for. ps often can display this field labelled "WCHAN" or something like that. It is a address in the kernel's memory space. Sometimes you can figure it out with adb. Some recent BSD versions actually decode this field. HP has a product called Glance that can decode it for HP-UX. I know that HP has a version of Glance for Solaris. I don't know if they have one for Tru64 or not. If they do, it is worth getting. It is the best performance tool I have seen.
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 09:42 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0