Messages in this thread | | | Subject | Re: [RFC][PATCH 2/5] signal: Add rwlock to protect sighand->action | From | Peter Zijlstra <> | Date | Fri, 30 Sep 2011 17:25:17 +0200 |
| |
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..
| |