Re: down_spin() implementation

From: Arnd Bergmann
Date: Fri Mar 28 2008 - 19:48:52 EST


On Friday 28 March 2008, Luck, Tony wrote:
> > So it makes little sense to add this to semaphores.  Better to introduce
> > a spinaphore, as you say.
>
> > struct {
> >   atomic_t cur;
> >   int max;
> > } ss_t;
>
> Could this API sneak into the bottom of one or the other of
> linux/include/{spinlock,semaphore}.h ... or should it get its own
> spinaphore.h file?
>
> Or should I follow Alan's earlier advice and keep this as an ia64
> only thing (since I'll be the only user).

If you use the simple version suggested last by Willy, I think it
could even be open-coded in your TLB management code.

Should we decided to make it an official interface, I'd suggest
putting it into atomic.h, because it operates on a plain atomic_t.

Arnd <><
--
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/