SCHED_4BSD: More than 1 process running on UP machine?

Ulrich Spoerlein uspoerlein at gmail.com
Sun Jul 1 08:41:01 UTC 2007


On Sun, 01.07.2007 at 03:17:46 +0200, Ivan Voras wrote:
> Ulrich Spoerlein wrote:
> > 7.x however, top(1) reports up to 7-8 running processes, depending on
> > how much stuff is going on.
> 
> The kernel in 7.x is SMP by default, so this might influence what you're
> seeing. I have a UP 7.x kernel and still see at most one process in RUN
> state.

I failed to mention, that I'm of course running an UP kernel as well.

It is happening during normal day to day usage, see this snapshot

last pid:  1879;  load averages:  0.84,  0.42,  0.36                         up 0+00:30:12  10:08:59
116 processes: 11 running, 104 sleeping, 1 zombie
CPU states: 61.8% user,  0.0% nice, 36.7% system,  1.5% interrupt,  0.0% idle
Mem: 455M Active, 31M Inact, 173M Wired, 5328K Cache, 29M Buf, 333M Free
Swap: 1024M Total, 1024M Free

  PID  THR PRI NICE   SIZE    RES STATE    TIME   WCPU COMMAND
 1872    1 122    0  5328K  4168K RUN      0:14 58.61% zsh
 1730    1  96    0 41696K 27476K RUN      0:54  3.08% kmldonkey
 1304    1  97    0   182M 56700K RUN      1:14  2.05% Xorg
 1517    6  96    0 80436K 56420K RUN      1:12  1.32% amarokapp
 1357    1  96    0   156M   142M RUN      0:58  0.00% opera
 1401    1  96    0 64696K 46136K select   0:10  0.00% kontact
 1378    7  96    0 63932K 45060K ucond    0:07  0.00% firefox-bin
 1328    1   8    0  4400K  2072K nanslp   0:05  0.00% wmtop
 1414    1  96    0 31264K 17520K select   0:05  0.00% kdeinit


Now, I might have gotten this wrong, but I think processes can be in
state RUNNABLE, that's when they are waiting in the run queue to be
scheduled. Or they might be actually RUNNING, when they have the time
slice of the processor. On a UP machine with UP kernel, at most 1
process can be running. So, why is top(1) lying? Is it taking a time
interval into account, instead of a snapshot in time?

Cheers,
Ulrich Spoerlein
-- 
"The trouble with the dictionary is you have to know how the word is
spelled before you can look it up to see how it is spelled."
-- Will Cuppy


More information about the freebsd-current mailing list