Re: [RFC][PATCH 2/5] signal: Add rwlock to protect sighand->action

Peter Zijlstra
2011-09-30T15:26:09Z

On Fri, 2011-09-30 at 16:12 +0100, Matt Fleming wrote:
>
> As sighand->action is read much more frequently than written a rwlock
> makes the most sense here.

Ha! you would think so, but then you'd forget that
read_lock()+read_unlock() are atomic ops modifying the lock state as
well. Furthermore rwlocks aren't fair by any means.

Therefore rwlock_t should never be used, use a spinlock_t possibly in
combination with RCU or seqcount etc..