Messages in this thread | | | From | "Manfred" <> | Subject | Re: [Patch] shm bug introduced with pagecache in 2.3.11 | Date | Sun, 21 Nov 1999 14:07:55 +0100 |
| |
Linus wrote: > But hey, I haven't actually done the full implementaion. I'm pretty > confident it can be done, but... > > Anyway, if your point was that two "trylocks" can race and neither get the > lock, then yes, you're right. That's what "trylock" is all about - it > won't schedule, it just will fail. That's obvious, I only used "write_lock_trylock()" as a shorthand for "lock;btrl RWL;jc, test ;jnz".
My pseudo-code describes a possible race if 1 CPU calls "down_exclusive()" and the second CPU calls "down_shared()", the lock is free. Boths CPU's could to enter the "slow" path, and unless you are really careful, then both CPU's could schedule(), and noone will wake them up.
I think the first reader must starve a sleeping writer, or we risk a lock-up.
-- 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/
| |