Subject: Re: 1.5S vs sparc/MP
To: None <pk@cs.few.eur.nl>
From: Simon J. Gerraty <sjg@quick.com.au>
List: tech-smp
Date: 03/07/2001 01:31:33
> kernel lock?  Should probably have the sleeper decrement sleepers when
> he wakesup, rather than when sema_signal calls wakeup_one(), I'll try
> that shortly.

That didn't seem to make any difference...

{0}sema_clear(0xf02b1544) count==0, sleepers==0
[BREAK]
Stopped at      cpu_Debugger+0x4:       jmpl            [%o7 + 0x8], %g0
db{0}> ps
 PID             PPID       PGRP        UID S   FLAGS          COMMAND    WAIT
 5                  0          0          0 3 0xa0204         aiodoned semvseg
 4                  0          0          0 3 0xa0204          ioflush  syncer
 3                  0          0          0 3 0x20204           reaper  reaper
 2                  0          0          0 3 0xa0204       pagedaemon pgdaemo
 1                  0          1          0 3 0x84004             init vmmaplk
 0                 -1          0          0 3 0xa0204          swapper schedul
db{0}> x/x cache_semaphore
cache_semaphore:        0
db{0}> 
cache_semaphore+0x4:    f02371c8
db{0}> 
cache_semaphore+0x8:    0
db{0}> 
cache_semaphore+0xc:    0
db{0}> 
cache_semaphore+0x10:   0
db{0}> 
cachestats:     88
db{0}> x/s f02371c8
openboot_special4m.194+0x498:   semcflush

But for laughs, lets call wakeup_one():

db{0}> call wakeup_one(cache_semaphore)
0xf02b1544
db{0}> ps
 PID             PPID       PGRP        UID S   FLAGS          COMMAND    WAIT
 5                  0          0          0 2 0xa0204         aiodoned
 4                  0          0          0 3 0xa0204          ioflush  syncer
 3                  0          0          0 3 0x20204           reaper  reaper
 2                  0          0          0 3 0xa0204       pagedaemon pgdaemo
 1                  0          1          0 3 0x84004             init vmmaplk
 0                 -1          0          0 3 0xa0204          swapper schedul

That looks better...

db{0}> c
[BREAK]
Stopped in pid 1 (init) at      cpu_Debugger+0x4:       jmpl            [%o7 + 0
x8], %g0
db{0}> ps
 PID             PPID       PGRP        UID S   FLAGS          COMMAND    WAIT
 5                  0          0          0 2 0xa0204         aiodoned
 4                  0          0          0 3 0xa0204          ioflush  syncer
 3                  0          0          0 3 0x20204           reaper  reaper
 2                  0          0          0 3 0xa0204       pagedaemon pgdaemo
>1                  0          1          0 7 0x84004             init
 0                 -1          0          0 3 0xa0204          swapper schedul
db{0}> 

As does that, we have init SONPROC - presumably spinning for the
kernel lock?  Is there an easy way to see who has it?

Thanks
--sjg