[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87bl48my75.mognet@arm.com>
Date: Fri, 01 Oct 2021 18:50:22 +0100
From: Valentin Schneider <valentin.schneider@....com>
To: Frederic Weisbecker <frederic@...nel.org>,
"Paul E . McKenney" <paulmck@...nel.org>
Cc: LKML <linux-kernel@...r.kernel.org>,
Thomas Gleixner <tglx@...utronix.de>,
Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
Peter Zijlstra <peterz@...radead.org>,
Uladzislau Rezki <urezki@...il.com>,
Frederic Weisbecker <frederic@...nel.org>,
Boqun Feng <boqun.feng@...il.com>,
Neeraj Upadhyay <neeraju@...eaurora.org>,
Josh Triplett <josh@...htriplett.org>,
Joel Fernandes <joel@...lfernandes.org>, rcu@...r.kernel.org
Subject: Re: [PATCH 04/11] rcu/nocb: Make rcu_core() callbacks acceleration preempt-safe
On 30/09/21 00:10, Frederic Weisbecker wrote:
> From: Thomas Gleixner <tglx@...utronix.de>
>
> While reporting a quiescent state for a given CPU, rcu_core() takes
> advantage of the freshly loaded grace period sequence number and the
> locked rnp to accelerate the callbacks whose sequence number have been
> assigned a stale value.
>
> This action is only necessary when the rdp isn't offloaded, otherwise
> the NOCB kthreads already take care of the callbacks progression.
>
> However the check for the offloaded state is volatile because it is
> performed outside the IRQs disabled section. It's possible for the
> offloading process to preempt rcu_core() at that point on PREEMPT_RT.
>
> This is dangerous because rcu_core() may end up accelerating callbacks
> concurrently with NOCB kthreads without appropriate locking.
>
> Fix this with moving the offloaded check inside the rnp locking section.
>
> Reported-by: Valentin Schneider <valentin.schneider@....com>
> Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
> Cc: Valentin Schneider <valentin.schneider@....com>
> Cc: Peter Zijlstra <peterz@...radead.org>
> Cc: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
> Cc: Josh Triplett <josh@...htriplett.org>
> Cc: Joel Fernandes <joel@...lfernandes.org>
> Cc: Boqun Feng <boqun.feng@...il.com>
> Cc: Neeraj Upadhyay <neeraju@...eaurora.org>
> Cc: Uladzislau Rezki <urezki@...il.com>
> Cc: Thomas Gleixner <tglx@...utronix.de>
> Signed-off-by: Frederic Weisbecker <frederic@...nel.org>
Reviewed-by: Valentin Schneider <valentin.schneider@....com>
Powered by blists - more mailing lists