Re: [PATCH] Replace completions with semaphores

From: Oliver Neukum
Date: Wed Apr 16 2008 - 12:38:41 EST


Am Mittwoch, 16. April 2008 18:34:14 schrieb Matthew Wilcox:
> On Wed, Apr 16, 2008 at 06:31:08PM +0200, Oliver Neukum wrote:
> > Am Mittwoch, 16. April 2008 18:16:52 schrieb Matthew Wilcox:
> > > The basic idea is that you get back a cookie from the kcounter_claim()
> > > which you have to hand to the kcounter_release() function so it
> > > knows which one you released. ?It's similar to mutex debugging except
> >
> > So in addition to the kcounter we need to save a token in a data structure?
> > In fact, there must be a data structure that can house that token. So you
> > can no longer live with a pointer just to a device descriptor, but every
> > individual use of a resource must have an associated data structure?
>
> That's right. Do you have an example where this would be inconvenient?
> I couldn't find one. For example, with USB, you could place one in the
> struct urb.

That's a data structure we really want to shrink. And furthermore, the needs
of the use cases should shape the locking primitives, not the reverse.

Regards
Oliver
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/