2

I am a little confused about the status of a process I have. It looks like this:

$ ps -eal | head -n 1 ; ps -eal | grep perf
F S   UID   PID  PPID  C PRI  NI ADDR SZ WCHAN  TTY          TIME CMD
4 S     0  7843  7842  0  80   0 - 10838 -      pts/6    00:00:00 perf

-- so, the status is S, which the man page describes as "S interruptible sleep (waiting for an event to complete)", it is waiting for some event. I assume it is listed in some waiting channel. But the waiting channel is: WCHAN -. Which man page describes with "Running tasks will display a dash ('-') in this column."

Plus, /proc/7843/status indeed contains State: S (sleeping) and /proc/7843/wchan contains 0. I guess 0 in proc//wchan tells the same thing -- that the task does not wait for anything.

Do I misunderstand something or do they contradict one another?

And the task indeed does not run -- I don't think - in wchan means it is waiting to be scheduled..

Could the wchan output be somehow misconfigured? I run Ubuntu 14.04, kernel 3.13.0-86-generic.

Checking other process shows:

$ ps -eal | head -n 1 ; ps -eal | grep fish
F S   UID   PID  PPID  C PRI  NI ADDR SZ WCHAN  TTY          TIME CMD
0 S  1000  2407  2399  0  80   0 - 47675 wait   pts/0    00:00:07 fish
1 S  1000  2409     1  0  80   0 -  5500 poll_s ?        00:00:00 fishd
0 S  1000  2507  2399  0  80   0 - 45333 poll_s pts/3    00:00:00 fish
0 S  1000  2567     1  0  80   0 -  8366 wait   ?        00:00:00 fish

-- so here WCHAN is ok.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.