lkml.org 
[lkml]   [2008]   [Mar]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] de-semaphorize smackfs
Hi!,

On Tue, Mar 18, 2008 at 9:35 AM, Christoph Hellwig <hch@infradead.org> wrote:
> On Mon, Mar 17, 2008 at 05:14:40PM -0600, Jonathan Corbet wrote:
> > While looking at the generic semaphore patch, I came to wonder what the
> > remaining semaphore users in the kernel were actually doing. After a
> > quick grep for down_interruptible(), smackfs remained at the bottom of
> > my screen. It seems like a straightforward mutex case - low-hanging
> > fruit. So here's a conversion patch; compile-tested only, but what
> > could go wrong?
>

I have a feeling that a very nice LWN article is under the way :).

>
> The lock is kept while returning to userspace and could potentially
> be release by another process. This is not allowed for mutexes.
>

Yes, this was an artifact of an old design where different processes
write _sessions_ were not allowed to interleave, thus locking them in
the very beginning (open).

Since now those sessions can be interleaved safely, I'll modify this
issue today to move the locking to each write() call instead.

Thanks Jonathan/Cristoph

--
Ahmed S. Darwish
Homepage: http://darwish.07.googlepages.com
Blog: http://darwish-07.blogspot.com


\
 
 \ /
  Last update: 2008-03-18 13:03    [W:0.047 / U:0.756 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site