Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

in ps -l, what does wchan=stext mean?

when I try to fine-tune my process, I see that the waiting channel is stext, what does it mean?

like image 872
akiva Avatar asked Jan 01 '09 10:01

akiva


3 Answers

WCHAN is the address within the kernel where the process is sleeping (if it is indeed sleeping). Having it set to stext usually means that your kernel predates 2.6 and you haven't initialized System.map (namelist file) or your kernel and namelist file don't match.

If you do a "man ps" and search for wchan, it will tell you the search path for the namelist file. It's likely the first one it's finding doesn't match the kernel you've got since stext is the start of the kernel TEXT segment and you're unlikely to be sleeping there.

I believe if the address is outside the TEXT segment, you'll get stext by default (hence my thoughts that your namelist file and kernel don't match).

like image 179
paxdiablo Avatar answered Nov 16 '22 05:11

paxdiablo


Kiwi - RHEL's ps should be picking up the namelist from /boot/System.map-2.6.18-53.1.14.el5PAE . I expect this is already installed. If it's working properly, then ps axo pid,cmd,wchan will produce a list of processes and the kernel functions they are waiting in. For mine, it's meaningful output for most functions, except for a few -- rpc.idmap and lockd. Several functions show "stext" and I would still like to know what this means.

like image 40
Otheus Avatar answered Nov 16 '22 05:11

Otheus


wchan is broken on x86 systems where the SCHED_NO_NO_OMIT_FRAME_POINTER has been set to "y" (which is the default value). In those systems wchan will always return "0" which maps to _stext

check http://lkml.org/lkml/2008/11/6/12 for further details

like image 32
Bhavin Turakhia Avatar answered Nov 16 '22 05:11

Bhavin Turakhia