Messages in this thread | | | Date | Wed, 21 Aug 2013 11:25:55 +0800 | From | Lai Jiangshan <> | Subject | Re: [PATCH 5/8] rcu: eliminate deadlock for rcu read site |
| |
On 08/21/2013 11:17 AM, Paul E. McKenney wrote: > On Sat, Aug 10, 2013 at 08:07:15AM -0700, Paul E. McKenney wrote: >> On Sat, Aug 10, 2013 at 11:43:59AM +0800, Lai Jiangshan wrote: > > [ . . . ] > >>> So I have to narrow the range of suspect locks. Two choices: >>> A) don't call rt_mutex_unlock() from rcu_read_unlock(), only call it >>> from rcu_preempt_not_context_switch(). we need to rework these >>> two functions and it will add complexity to RCU, and it also still >>> adds some probability of deferring. >> >> One advantage of bh-disable locks is that enabling bh checks >> TIF_NEED_RESCHED, so that there is no deferring beyond that >> needed by bh disable. The same of course applies to preempt_disable(). >> >> So one approach is to defer when rcu_read_unlock_special() is entered >> with either preemption or bh disabled. Your current set_need_resched() >> trick would work fine in this case. Unfortunately, re-enabling interrupts >> does -not- check TIF_NEED_RESCHED, which is why we have latency problems >> in that case. (Hence my earlier question about making self-IPI safe >> on all arches, which would result in an interrupt as soon as interrupts >> were re-enabled.) >> >> Another possibility is to defer only when preemption or bh are disabled >> on entry ro rcu_read_unlock_special(), but to retain the current >> (admittedly ugly) nesting rules for the scheduler locks. > > Would you be willing to do a patch that deferred rt_mutex_unlock() in > the preempt/bh cases? This of course does not solve the irq-disable > case, but it should at least narrow the problem to the scheduler locks. > > Not a big hurry, given the testing required, this is 3.13 or 3.14 material, > I think. > > If you are busy, no problem, I can do it, just figured you have priority > if you want it. > >
I'm writing a special rt_mutex_unlock() for rcu deboost only. I hope Steven accept it.
Thanks, Lai
| |