[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aEeBJQ8go5wH1XCp@tardis.local>
Date: Mon, 9 Jun 2025 17:49:41 -0700
From: Boqun Feng <boqun.feng@...il.com>
To: Frederic Weisbecker <frederic@...nel.org>
Cc: Joel Fernandes <joelagnelf@...dia.com>, linux-kernel@...r.kernel.org,
"Paul E. McKenney" <paulmck@...nel.org>,
Neeraj Upadhyay <neeraj.upadhyay@...nel.org>,
Joel Fernandes <joel@...lfernandes.org>,
Josh Triplett <josh@...htriplett.org>,
Uladzislau Rezki <urezki@...il.com>,
Steven Rostedt <rostedt@...dmis.org>,
Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
Lai Jiangshan <jiangshanlai@...il.com>,
Zqiang <qiang.zhang1211@...il.com>,
Xiongfeng Wang <wangxiongfeng2@...wei.com>, rcu@...r.kernel.org,
bpf@...r.kernel.org
Subject: Re: [PATCH 2/2] rcu: Fix lockup when RCU reader used while IRQ
exiting
On Tue, Jun 10, 2025 at 01:26:46AM +0200, Frederic Weisbecker wrote:
> Le Mon, Jun 09, 2025 at 12:49:06PM -0700, Boqun Feng a écrit :
> > Hi Joel,
> >
> > On Mon, Jun 09, 2025 at 02:01:24PM -0400, Joel Fernandes wrote:
> > > During rcu_read_unlock_special(), if this happens during irq_exit(), we
> > > can lockup if an IPI is issued. This is because the IPI itself triggers
> > > the irq_exit() path causing a recursive lock up.
> > >
> > > This is precisely what Xiongfeng found when invoking a BPF program on
> > > the trace_tick_stop() tracepoint As shown in the trace below. Fix by
> > > using context-tracking to tell us if we're still in an IRQ.
> > > context-tracking keeps track of the IRQ until after the tracepoint, so
> > > it cures the issues.
> > >
> >
> > This does fix the issue, but do we know when the CPU will eventually
> > report a QS after this fix? I believe we still want to report a QS as
> > early as possible in this case?
>
> If !ct_in_irq(), we issue a self-IPI, then preempt_schedule_irq() will
> call into schedule() and report a QS (if preempt/bh is not disabled, otherwise
> this is delayed to preempt_enable() or local_bh_enable() issuing preempt_schedule())
>
> If ct_in_irq(), we are already in an IRQ, then it's the same as above
> eventually.
>
I see, I was missing this, thanks for pointing out ;-)
Regards,
Boqun
> Thanks.
>
> --
> Frederic Weisbecker
> SUSE Labs
>
Powered by blists - more mailing lists