lkml.org 
[lkml]   [1999]   [Nov]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [Patch] shm bug introduced with pagecache in 2.3.11
Date
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/

\
 
 \ /
  Last update: 2005-03-22 13:55    [W:0.023 / U:0.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site