Re: Usage semantics of atomic_set ( )

2008-01-12 Thread Vineet Gupta
> What operations are you using to implement spinlocks? The cpu provides atomic exchange instruction (atomic Read/write semantics) which forms the back end of spin lock code. __raw_spin_trylock( ) atomically swaps the lock memory with a reg (set to 1) Using a pool of spinlocks rather that

Re: Usage semantics of atomic_set ( )

2008-01-12 Thread Vineet Gupta
What operations are you using to implement spinlocks? The cpu provides atomic exchange instruction (atomic Read/write semantics) which forms the back end of spin lock code. __raw_spin_trylock( ) atomically swaps the lock memory with a reg (set to 1) Using a pool of spinlocks rather that

Re: Usage semantics of atomic_set ( )

2008-01-11 Thread Chris Snook
Vineet Gupta wrote: I'm trying to implement atomic ops for a CPU which has no inherent support for Read-Modify-Write Ops. Instead of using a global spin lock which protects all the atomic APIs, I want to use a spin lock per instance of atomic_t. What operations are you using to implement

Re: Usage semantics of atomic_set ( )

2008-01-11 Thread Roland Dreier
> I'm trying to implement atomic ops for a CPU which has no inherent > support for Read-Modify-Write Ops. Instead of using a global spin lock > which protects all the atomic APIs, I want to use a spin lock per > instance of atomic_t. This works well when atomic_t is unitary and > statically

Re: Usage semantics of atomic_set ( )

2008-01-11 Thread Roland Dreier
I'm trying to implement atomic ops for a CPU which has no inherent support for Read-Modify-Write Ops. Instead of using a global spin lock which protects all the atomic APIs, I want to use a spin lock per instance of atomic_t. This works well when atomic_t is unitary and statically

Re: Usage semantics of atomic_set ( )

2008-01-11 Thread Chris Snook
Vineet Gupta wrote: I'm trying to implement atomic ops for a CPU which has no inherent support for Read-Modify-Write Ops. Instead of using a global spin lock which protects all the atomic APIs, I want to use a spin lock per instance of atomic_t. What operations are you using to implement