Skip to contentSkip to conversation

FYI: kernel semaphore bug

parisc-linux Matthew Wilcox 1 participant 1 message Mar 22, 2001

lore
Share & tools
lore
#0 lore raw

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.

Signature · 1 line
Revolutions do not require corporate support.