But I think the inline part of up_write() is wrong:
I think __rwsem_wake is always called:
lock is free: sem->val = RWSEM_BIAS
down_write()
sem->val is now 0.
up_write():
"addl BIAS,&sem->val" new value: 0x0100 0000
"jge slow_part"
jge means jump if SignFlag == OverflowFlag.
add from 0 to 0x01000 0000 means SF =0, OF = 0.
--> the jump is always taken.
I guess you need "jump if the old value was below zero"
this would be "jump if sign or carry", but this instruction doesn't
exist.
-- Manfred
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/