lkml.org 
[lkml]   [1999]   [Nov]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [Patch] shm bug introduced with pagecache in 2.3.11

On Sat, 20 Nov 1999, Manfred Spraul wrote:

> I never figured out how to upgrade a reader to a writer:
> what if 2 threads acquire the lock 'read', and and both decide to
> promote to "write"?

yes, it's deadlock-land. I had a patch that did this, we can promote a
writer to a reader very cheaply (only one locked-add 0x80000001), but it's
a bit unfinished without having a clean reader-to-writer path. The
reader-to-write path is conceptually hard, because if we fail to get the
write bit immediately then we _have to_ unlock the spinlock (even the read
count) to not deadlock, and this has user-visible effects: in this case
the user cannot assume anymore than the data structure is not modified =>
we are back to the original complexity of restarting the whole thing with
the write lock held. Very little performance gain for lots of hassle.

-- mingo


-
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.058 / U:0.136 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site