[parisc-linux] FYI: kernel semaphore bug

Matthew Wilcox matthew@wil.cx
Thu, 22 Mar 2001 21:49:40 +0000


there's a minor problem that probably won't affect anyone which occurs
under rare conditions with contention on an N-way semaphore.  It will be
fixed by upgrading to 2.4.2 so I'm not going to put in a workaround.

for the curious:

P1: down()
P2: down()
P3: down() -- sleeps
P4: down() -- sleeps
P1: up() -- calls wake_up
P2: up() -- calls wake_up

wake_up will only wake P3 and not P4.  This is fixed in the wait_queue
rewrite in 2.4.2.  I could hack it by having P3 check whether the queue
still had tasks on it and the semaphore count was >0 and do a wake_up
itself in that case.  But I'm not going to do that.

-- 
Revolutions do not require corporate support.