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."
--