Re: Announce: Semaphore-Removal tree

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Matthew Wilcox
Date: Monday, April 28, 2008 - 7:35 pm

On Tue, Apr 29, 2008 at 10:09:30AM +1000, David Chinner wrote:

Perhaps you can suggest a better one?  Our thought was that you have ...

struct xfs_inode {
	struct kcounter_t i_flock
};

struct foo {
	... other stuff you need for the io ...
	kcounter_cookie_t kct;
}

	int err = kcounter_claim(&ino->i_flock, &foo->kct);
...
	kcounter_release(&ino->i_flock, &foo->kct);


If you're always using trylock semantics on it, then it's not really a
semaphore, is it?


Up to 2 billion.


... but not just trylocks, right?  There's a sleeping aspect to them
too.


OK.


I don't want to say that.  People (and I'm *not* referring to XFS here)
manage to abuse semaphores in the most hideous ways.  If we tell them to
use lower-level constructs, they'll make a mess of using those too.  I
think we need to look for patterns in the semaphore users which don't
fit the mutex pattern or the completion pattern and figure out how to
satisfy those users.


I don't think there are any plans to get rid of rwsems, though the RT
people probably hate rwsems even more than they hate regular semaphores.
The mmap rwsem is a compelling argument ;-)

-- 
Intel are signing my paycheques ... these opinions are still mine
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours.  We can't possibly take such
a retrograde step."
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Announce: Semaphore-Removal tree, Matthew Wilcox, (Fri Apr 25, 10:00 am)
Re: Announce: Semaphore-Removal tree, Daniel Walker, (Fri Apr 25, 1:24 pm)
Re: Announce: Semaphore-Removal tree, Daniel Walker, (Fri Apr 25, 1:38 pm)
Re: Announce: Semaphore-Removal tree, Christoph Hellwig, (Fri Apr 25, 2:12 pm)
Re: Announce: Semaphore-Removal tree, Daniel Walker, (Fri Apr 25, 2:22 pm)
Re: Announce: Semaphore-Removal tree, Christoph Hellwig, (Sat Apr 26, 2:30 am)
Re: Announce: Semaphore-Removal tree, Peter Zijlstra, (Sat Apr 26, 6:39 am)
Re: Announce: Semaphore-Removal tree, Christoph Hellwig, (Sat Apr 26, 6:44 am)
Re: Announce: Semaphore-Removal tree, Stephen Rothwell, (Sat Apr 26, 6:54 am)
Re: Announce: Semaphore-Removal tree, Peter Zijlstra, (Sat Apr 26, 7:04 am)
Re: Announce: Semaphore-Removal tree, Matthew Wilcox, (Sat Apr 26, 8:59 am)
Re: Announce: Semaphore-Removal tree, Stephen Rothwell, (Sat Apr 26, 9:43 am)
Re: Announce: Semaphore-Removal tree, David Chinner, (Sun Apr 27, 9:59 pm)
Re: Announce: Semaphore-Removal tree, David Chinner, (Sun Apr 27, 10:10 pm)
Re: Announce: Semaphore-Removal tree, Matthew Wilcox, (Mon Apr 28, 5:20 am)
Re: Announce: Semaphore-Removal tree, David Chinner, (Mon Apr 28, 5:09 pm)
Re: Announce: Semaphore-Removal tree, Matthew Wilcox, (Mon Apr 28, 7:35 pm)
Re: Announce: Semaphore-Removal tree, David Chinner, (Mon Apr 28, 8:56 pm)
Re: Announce: Semaphore-Removal tree, Matthew Wilcox, (Wed Apr 30, 3:06 am)
Re: Announce: Semaphore-Removal tree, Matthew Wilcox, (Wed Apr 30, 3:21 am)
Re: Announce: Semaphore-Removal tree, David Chinner, (Wed Apr 30, 4:01 am)