On Mon, Mar 07, 2022 at 12:17:55PM +0100, Sebastian Andrzej Siewior wrote: > On 2022-03-04 20:40:07 [-0800], Paul E. McKenney wrote: > > > This is what I had in mind. Does this work for you? > > > > This does seem to be working, thank you! I even manually inserted > > a pi_lock() acquisition across one of the calls to call_rcu_tasks(), > > and it did seem to work. > > perfect. Sounds like I should add that to rcutorture. > > > kernel/rcu/tasks.h | 14 ++++++++------ > > > 1 file changed, 8 insertions(+), 6 deletions(-) > > > > > > diff --git a/kernel/rcu/tasks.h b/kernel/rcu/tasks.h > > > index d64f0b1d8cd3b..f804afb304135 100644 > > > --- a/kernel/rcu/tasks.h > > > +++ b/kernel/rcu/tasks.h > > > @@ -113,11 +113,11 @@ static void call_rcu_tasks_iw_wakeup(struct irq_work *iwp); > > > #define DEFINE_RCU_TASKS(rt_name, gp, call, n) \ > > > static DEFINE_PER_CPU(struct rcu_tasks_percpu, rt_name ## __percpu) = { \ > > > .lock = __RAW_SPIN_LOCK_UNLOCKED(rt_name ## __percpu.cbs_pcpu_lock), \ > > > - .rtp_irq_work = IRQ_WORK_INIT(call_rcu_tasks_iw_wakeup), \ > > > + .rtp_irq_work = IRQ_WORK_INIT_HARD(call_rcu_tasks_iw_wakeup), \ > > > > This is the key piece, right? > > Correct. Possible due to the removal of wait_queue_head (plus there is > nothing else that would stand in the way otherwise). Very good! If the overhead becomes a problem in mainline, presumably we can do a compile-time switch based on CONFIG_PREEMPT_RT or similar. > > If so, I am wondering if there are other > > irq_work instances that need to move to _HARD. > > We already have: > kernel/rcu/tree.c: rdp->rcu_iw = IRQ_WORK_INIT_HARD(rcu_iw_handler); Because you prompted me to change it from IRQ_WORK_INIT() some time back? ;-) Thanx, Paul