On 01/23, Michel Lespinasse wrote: > > On Tue, Jan 22, 2013 at 11:32 AM, Steven Rostedt <[email protected]> wrote: > > > > I thought global locks are now fair. That is, a reader will block if a > > writer is waiting. Hence, the above should deadlock on the current > > rwlock_t types. > > I believe you are mistaken here. struct rw_semaphore is fair (and > blocking), but rwlock_t is unfair. The reason we can't easily make > rwlock_t fair is because tasklist_lock currently depends on the > rwlock_t unfairness - tasklist_lock readers typically don't disable > local interrupts, and tasklist_lock may be acquired again from within > an interrupt, which would deadlock if rwlock_t was fair and a writer > was queued by the time the interrupt is processed.
Yes. And, iirc, it was even documented somewhere that while rwlock_t is not really nice, it is good to share the locking with interrupts. You do not need to disable irqs. Oleg. _______________________________________________ Linuxppc-dev mailing list [email protected] https://lists.ozlabs.org/listinfo/linuxppc-dev
