* [PATCH] rcu: Stop re-initializing ->boost_mtx on every boost cycle
@ 2026-12-04 10:08 Ziwei Dai
2026-12-04 18:46 ` Paul E. McKenney
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Ziwei Dai @ 2026-12-04 10:08 UTC (permalink / raw)
To: rcu, linux-kernel
Cc: Paul E . McKenney, Frederic Weisbecker, Neeraj Upadhyay,
Joel Fernandes, Josh Triplett, Boqun Feng, Uladzislau Rezki,
Steven Rostedt, Mathieu Desnoyers, Peter Zijlstra, Ingo Molnar,
Will Deacon, Waiman Long, Lai Jiangshan, Zqiang, lina.yang
rcu_boost() calls rt_mutex_init_proxy_locked() on the permanently
embedded rcu_node::boost_mtx at the beginning of every boost cycle.
That helper runs __rt_mutex_base_init(), which rewrites lock->wait_lock
via raw_spin_lock_init().
The rewritten spinlock may still be in use by the task that was
boosted in the previous cycle. That task releases ->boost_mtx with
rt_mutex_futex_unlock() from rcu_preempt_deferred_qs_irqrestore(),
and it does so *after* raw_spin_unlock_irqrestore_rcu_node().
rnp->lock therefore does not serialize that release against the next
round's re-initialization, contrary to what the comment in rcu_boost()
claims.
Nothing else serializes the two, either. rt_mutex_futex_unlock()
clears ->owner under ->wait_lock, and only then releases ->wait_lock.
As soon as ->owner is NULL, the rt_mutex_lock()/rt_mutex_unlock() pair
of the boost kthread takes the fast path, which does not touch
->wait_lock at all. The kthread can thus complete that pair, return
from rcu_boost(), enter rcu_boost() again and re-initialize
->boost_mtx while the previous owner is still inside the wait_lock
critical section of its rt_mutex_futex_unlock().
When this happens, the non-atomic rewrite lands on a spinlock that
another CPU currently holds. On ARM32, which uses ticket spinlocks,
this was observed on a 32-bit ARM system with CONFIG_DEBUG_SPINLOCK=y
during a reboot stress test (the RCU boost code there is identical to
mainline) as a lock word going from 0x00010000 (next=1, owner=0:
held) to 0x00010001 (next=1, owner=1: free) while the real holder was
still inside the critical section: the re-initialization clears the
lock word, the unlock of the previous holder increments the owner
ticket, and the next acquisition of the boost kthread then "succeeds"
on a lock word with owner == next. The unlock of the boost kthread
fails
SPIN_BUG_ON(!raw_spin_is_locked(lock), lock, "already unlocked");
in debug_spin_unlock() and panics:
BUG: spinlock already unlocked on CPU#1, rcub/0/22
lock: rcu_state+0x6c/0x880, .magic: dead4ead, .owner: rcub/0/22, .owner_cpu: 1
On architectures using qspinlocks the tail/pending encoding of a
queued waiter is lost instead, so the failure is expected to be less
obvious there (a hang or silent corruption rather than a clean BUG()).
Fix it by initializing ->boost_mtx exactly once, in
rcu_spawn_one_boost_kthread(), before the boost kthread is published
via ->boost_kthread_task and hence before any rcu_boost() can run.
Each boost cycle now only transfers ownership through the new
rt_mutex_boost_set_owner(), which is rt_mutex_init_proxy_locked() minus
the destructive re-initialization.
This is safe because the waiters tree is always empty at the start of a
boost cycle: rcu_boost() is only called by the single per-rcu_node
boost kthread, which completes its rt_mutex_lock()/rt_mutex_unlock()
pair before returning. A WARN_ON_ONCE() documents and checks that
invariant.
Fixes: 02a7c234e540 ("rcu: Suppress lockdep false-positive ->boost_mtx complaints")
Reported-by: Houtang Zhang <houtang.zhang@unisoc.com>
Signed-off-by: Ziwei Dai <ziwei.dai@unisoc.com>
---
kernel/locking/rtmutex_api.c | 35 +++++++++++++++++++++++++++++++++
kernel/locking/rtmutex_common.h | 2 ++
kernel/rcu/tree_plugin.h | 29 ++++++++++++++++++++++++++-
3 files changed, 65 insertions(+), 1 deletion(-)
diff --git a/kernel/locking/rtmutex_api.c b/kernel/locking/rtmutex_api.c
index eb18b09..19422b7 100644
--- a/kernel/locking/rtmutex_api.c
+++ b/kernel/locking/rtmutex_api.c
@@ -294,6 +294,41 @@ void __sched rt_mutex_init_proxy_locked(struct rt_mutex_base *lock,
rt_mutex_set_owner(lock, proxy_owner);
}
+/**
+ * rt_mutex_boost_set_owner - make an initialized rt_mutex appear to be held
+ by @proxy_owner
+ * @lock: the rt_mutex, which must have been initialized already
+ * @proxy_owner: the task to set as owner
+ *
+ * No locking. Caller has to do serializing itself.
+ *
+ * Counterpart of rt_mutex_init_proxy_locked() for RCU priority boosting,
+ * which reuses a single, permanently embedded rt_mutex
+ * (rcu_node::boost_mtx) for every boost cycle. This performs exactly the
+ * same owner assignment, but deliberately does *not* re-initialize @lock
+ * and therefore does not rewrite lock->wait_lock.
+ *
+ * Re-initializing ->wait_lock is not possible once the mutex is in use.
+ * The task which was boosted in the previous cycle releases ->boost_mtx
+ * via rt_mutex_futex_unlock(), and it does so without holding the rcu_node
+ * lock. The ->owner = NULL store in that path happens while ->wait_lock
+ * is held, so the fast path of rt_mutex_lock() can already succeed at
+ * that point. Rewriting ->wait_lock from the boost kthread in this
+ * window lands on a spinlock which the other CPU still holds, which
+ * corrupts the lock word (on ARM32 ticket spinlocks the previous holder
+ * then trips "BUG: spinlock already unlocked") or, worse, lets two CPUs
+ * run inside the wait_lock protected section at the same time.
+ *
+ * Callers must initialize @lock once, up front, and use this function for
+ * every subsequent ownership transfer. @lock must be free and have no
+ * waiters queued when this is called.
+ */
+void __sched rt_mutex_boost_set_owner(struct rt_mutex_base *lock,
+ struct task_struct *proxy_owner)
+{
+ rt_mutex_set_owner(lock, proxy_owner);
+}
+
/**
* rt_mutex_proxy_unlock - release a lock on behalf of owner
*
diff --git a/kernel/locking/rtmutex_common.h b/kernel/locking/rtmutex_common.h
index c38b7bd..6167c87 100644
--- a/kernel/locking/rtmutex_common.h
+++ b/kernel/locking/rtmutex_common.h
@@ -81,6 +81,8 @@ struct rt_wake_q_head {
extern void rt_mutex_init_proxy_locked(struct rt_mutex_base *lock,
struct task_struct *proxy_owner)
__must_hold(&lock->wait_lock);
+extern void rt_mutex_boost_set_owner(struct rt_mutex_base *lock,
+ struct task_struct *proxy_owner);
extern void rt_mutex_proxy_unlock(struct rt_mutex_base *lock)
__must_hold(&lock->wait_lock);
diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h
index ae5d21b..11f5acf 100644
--- a/kernel/rcu/tree_plugin.h
+++ b/kernel/rcu/tree_plugin.h
@@ -1222,9 +1222,22 @@ static int rcu_boost(struct rcu_node *rnp)
* rnp->lock also resolves races between our priority boosting
* and task t's exiting its outermost RCU read-side critical
* section.
+ *
+ * But rnp->lock does not cover the release of ->boost_mtx itself:
+ * the task boosted in the previous cycle drops it with
+ * rt_mutex_futex_unlock() *after* it has dropped rnp->lock, so that
+ * release can still be in flight here. Never re-initialize
+ * ->boost_mtx, as that would rewrite ->wait_lock while the other CPU
+ * might still hold it. ->boost_mtx was initialized once by
+ * rcu_spawn_one_boost_kthread(), so only transfer the ownership.
+ *
+ * The waiters tree must be empty here: rcu_boost() is only ever
+ * called by this rcu_node's single boost kthread, which completes
+ * its rt_mutex_lock()/rt_mutex_unlock() pair before returning.
*/
t = container_of(tb, struct task_struct, rcu_node_entry);
- rt_mutex_init_proxy_locked(&rnp->boost_mtx.rtmutex, t);
+ WARN_ON_ONCE(!RB_EMPTY_ROOT(&rnp->boost_mtx.rtmutex.waiters.rb_root));
+ rt_mutex_boost_set_owner(&rnp->boost_mtx.rtmutex, t);
raw_spin_unlock_irqrestore_rcu_node(rnp, flags);
/* Lock only for side effect: boosts task t's priority. */
rt_mutex_lock(&rnp->boost_mtx);
@@ -1334,6 +1347,20 @@ static void rcu_spawn_one_boost_kthread(struct rcu_node *rnp)
if (WARN_ON_ONCE(IS_ERR(t)))
return;
+ /*
+ * Initialize ->boost_mtx exactly once, here, before it is made
+ * reachable through ->boost_kthread_task and therefore before the
+ * first rcu_boost() can run. Passing a NULL proxy owner leaves the
+ * mutex unlocked and unowned, and applies the same lockdep class to
+ * ->wait_lock that rt_mutex_init_proxy_locked() used to re-apply on
+ * every boost cycle.
+ *
+ * rcu_boost() only transfers the ownership of ->boost_mtx from now
+ * on, so that ->wait_lock is never rewritten while the task boosted
+ * in the previous cycle may still be inside rt_mutex_futex_unlock().
+ */
+ rt_mutex_init_proxy_locked(&rnp->boost_mtx.rtmutex, NULL);
+
raw_spin_lock_irqsave_rcu_node(rnp, flags);
rnp->boost_kthread_task = t;
raw_spin_unlock_irqrestore_rcu_node(rnp, flags);
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] rcu: Stop re-initializing ->boost_mtx on every boost cycle
2026-12-04 10:08 [PATCH] rcu: Stop re-initializing ->boost_mtx on every boost cycle Ziwei Dai
@ 2026-12-04 18:46 ` Paul E. McKenney
2026-12-05 9:55 ` kernel test robot
2026-12-05 9:55 ` kernel test robot
2 siblings, 0 replies; 4+ messages in thread
From: Paul E. McKenney @ 2026-12-04 18:46 UTC (permalink / raw)
To: Ziwei Dai
Cc: rcu, linux-kernel, Frederic Weisbecker, Neeraj Upadhyay,
Joel Fernandes, Josh Triplett, Boqun Feng, Uladzislau Rezki,
Steven Rostedt, Mathieu Desnoyers, Peter Zijlstra, Ingo Molnar,
Will Deacon, Waiman Long, Lai Jiangshan, Zqiang, lina.yang
On Fri, Dec 04, 2026 at 06:08:30PM +0800, Ziwei Dai wrote:
> rcu_boost() calls rt_mutex_init_proxy_locked() on the permanently
> embedded rcu_node::boost_mtx at the beginning of every boost cycle.
> That helper runs __rt_mutex_base_init(), which rewrites lock->wait_lock
> via raw_spin_lock_init().
>
> The rewritten spinlock may still be in use by the task that was
> boosted in the previous cycle. That task releases ->boost_mtx with
> rt_mutex_futex_unlock() from rcu_preempt_deferred_qs_irqrestore(),
> and it does so *after* raw_spin_unlock_irqrestore_rcu_node().
> rnp->lock therefore does not serialize that release against the next
> round's re-initialization, contrary to what the comment in rcu_boost()
> claims.
>
> Nothing else serializes the two, either. rt_mutex_futex_unlock()
> clears ->owner under ->wait_lock, and only then releases ->wait_lock.
> As soon as ->owner is NULL, the rt_mutex_lock()/rt_mutex_unlock() pair
> of the boost kthread takes the fast path, which does not touch
> ->wait_lock at all. The kthread can thus complete that pair, return
> from rcu_boost(), enter rcu_boost() again and re-initialize
> ->boost_mtx while the previous owner is still inside the wait_lock
> critical section of its rt_mutex_futex_unlock().
>
> When this happens, the non-atomic rewrite lands on a spinlock that
> another CPU currently holds. On ARM32, which uses ticket spinlocks,
> this was observed on a 32-bit ARM system with CONFIG_DEBUG_SPINLOCK=y
> during a reboot stress test (the RCU boost code there is identical to
> mainline) as a lock word going from 0x00010000 (next=1, owner=0:
> held) to 0x00010001 (next=1, owner=1: free) while the real holder was
> still inside the critical section: the re-initialization clears the
> lock word, the unlock of the previous holder increments the owner
> ticket, and the next acquisition of the boost kthread then "succeeds"
> on a lock word with owner == next. The unlock of the boost kthread
> fails
>
> SPIN_BUG_ON(!raw_spin_is_locked(lock), lock, "already unlocked");
>
> in debug_spin_unlock() and panics:
>
> BUG: spinlock already unlocked on CPU#1, rcub/0/22
> lock: rcu_state+0x6c/0x880, .magic: dead4ead, .owner: rcub/0/22, .owner_cpu: 1
>
> On architectures using qspinlocks the tail/pending encoding of a
> queued waiter is lost instead, so the failure is expected to be less
> obvious there (a hang or silent corruption rather than a clean BUG()).
>
> Fix it by initializing ->boost_mtx exactly once, in
> rcu_spawn_one_boost_kthread(), before the boost kthread is published
> via ->boost_kthread_task and hence before any rcu_boost() can run.
> Each boost cycle now only transfers ownership through the new
> rt_mutex_boost_set_owner(), which is rt_mutex_init_proxy_locked() minus
> the destructive re-initialization.
>
> This is safe because the waiters tree is always empty at the start of a
> boost cycle: rcu_boost() is only called by the single per-rcu_node
> boost kthread, which completes its rt_mutex_lock()/rt_mutex_unlock()
> pair before returning. A WARN_ON_ONCE() documents and checks that
> invariant.
>
> Fixes: 02a7c234e540 ("rcu: Suppress lockdep false-positive ->boost_mtx complaints")
> Reported-by: Houtang Zhang <houtang.zhang@unisoc.com>
> Signed-off-by: Ziwei Dai <ziwei.dai@unisoc.com>
Good catch, and nice fix, at least from an RCU viewpoint. ;-)
Reviewed-by: Paul E. McKenney <paulmck@kernel.org>
> ---
> kernel/locking/rtmutex_api.c | 35 +++++++++++++++++++++++++++++++++
> kernel/locking/rtmutex_common.h | 2 ++
> kernel/rcu/tree_plugin.h | 29 ++++++++++++++++++++++++++-
> 3 files changed, 65 insertions(+), 1 deletion(-)
>
> diff --git a/kernel/locking/rtmutex_api.c b/kernel/locking/rtmutex_api.c
> index eb18b09..19422b7 100644
> --- a/kernel/locking/rtmutex_api.c
> +++ b/kernel/locking/rtmutex_api.c
> @@ -294,6 +294,41 @@ void __sched rt_mutex_init_proxy_locked(struct rt_mutex_base *lock,
> rt_mutex_set_owner(lock, proxy_owner);
> }
>
> +/**
> + * rt_mutex_boost_set_owner - make an initialized rt_mutex appear to be held
> + by @proxy_owner
> + * @lock: the rt_mutex, which must have been initialized already
> + * @proxy_owner: the task to set as owner
> + *
> + * No locking. Caller has to do serializing itself.
> + *
> + * Counterpart of rt_mutex_init_proxy_locked() for RCU priority boosting,
> + * which reuses a single, permanently embedded rt_mutex
> + * (rcu_node::boost_mtx) for every boost cycle. This performs exactly the
> + * same owner assignment, but deliberately does *not* re-initialize @lock
> + * and therefore does not rewrite lock->wait_lock.
> + *
> + * Re-initializing ->wait_lock is not possible once the mutex is in use.
> + * The task which was boosted in the previous cycle releases ->boost_mtx
> + * via rt_mutex_futex_unlock(), and it does so without holding the rcu_node
> + * lock. The ->owner = NULL store in that path happens while ->wait_lock
> + * is held, so the fast path of rt_mutex_lock() can already succeed at
> + * that point. Rewriting ->wait_lock from the boost kthread in this
> + * window lands on a spinlock which the other CPU still holds, which
> + * corrupts the lock word (on ARM32 ticket spinlocks the previous holder
> + * then trips "BUG: spinlock already unlocked") or, worse, lets two CPUs
> + * run inside the wait_lock protected section at the same time.
> + *
> + * Callers must initialize @lock once, up front, and use this function for
> + * every subsequent ownership transfer. @lock must be free and have no
> + * waiters queued when this is called.
> + */
> +void __sched rt_mutex_boost_set_owner(struct rt_mutex_base *lock,
> + struct task_struct *proxy_owner)
> +{
> + rt_mutex_set_owner(lock, proxy_owner);
> +}
> +
> /**
> * rt_mutex_proxy_unlock - release a lock on behalf of owner
> *
> diff --git a/kernel/locking/rtmutex_common.h b/kernel/locking/rtmutex_common.h
> index c38b7bd..6167c87 100644
> --- a/kernel/locking/rtmutex_common.h
> +++ b/kernel/locking/rtmutex_common.h
> @@ -81,6 +81,8 @@ struct rt_wake_q_head {
> extern void rt_mutex_init_proxy_locked(struct rt_mutex_base *lock,
> struct task_struct *proxy_owner)
> __must_hold(&lock->wait_lock);
> +extern void rt_mutex_boost_set_owner(struct rt_mutex_base *lock,
> + struct task_struct *proxy_owner);
>
> extern void rt_mutex_proxy_unlock(struct rt_mutex_base *lock)
> __must_hold(&lock->wait_lock);
> diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h
> index ae5d21b..11f5acf 100644
> --- a/kernel/rcu/tree_plugin.h
> +++ b/kernel/rcu/tree_plugin.h
> @@ -1222,9 +1222,22 @@ static int rcu_boost(struct rcu_node *rnp)
> * rnp->lock also resolves races between our priority boosting
> * and task t's exiting its outermost RCU read-side critical
> * section.
> + *
> + * But rnp->lock does not cover the release of ->boost_mtx itself:
> + * the task boosted in the previous cycle drops it with
> + * rt_mutex_futex_unlock() *after* it has dropped rnp->lock, so that
> + * release can still be in flight here. Never re-initialize
> + * ->boost_mtx, as that would rewrite ->wait_lock while the other CPU
> + * might still hold it. ->boost_mtx was initialized once by
> + * rcu_spawn_one_boost_kthread(), so only transfer the ownership.
> + *
> + * The waiters tree must be empty here: rcu_boost() is only ever
> + * called by this rcu_node's single boost kthread, which completes
> + * its rt_mutex_lock()/rt_mutex_unlock() pair before returning.
> */
> t = container_of(tb, struct task_struct, rcu_node_entry);
> - rt_mutex_init_proxy_locked(&rnp->boost_mtx.rtmutex, t);
> + WARN_ON_ONCE(!RB_EMPTY_ROOT(&rnp->boost_mtx.rtmutex.waiters.rb_root));
> + rt_mutex_boost_set_owner(&rnp->boost_mtx.rtmutex, t);
> raw_spin_unlock_irqrestore_rcu_node(rnp, flags);
> /* Lock only for side effect: boosts task t's priority. */
> rt_mutex_lock(&rnp->boost_mtx);
> @@ -1334,6 +1347,20 @@ static void rcu_spawn_one_boost_kthread(struct rcu_node *rnp)
> if (WARN_ON_ONCE(IS_ERR(t)))
> return;
>
> + /*
> + * Initialize ->boost_mtx exactly once, here, before it is made
> + * reachable through ->boost_kthread_task and therefore before the
> + * first rcu_boost() can run. Passing a NULL proxy owner leaves the
> + * mutex unlocked and unowned, and applies the same lockdep class to
> + * ->wait_lock that rt_mutex_init_proxy_locked() used to re-apply on
> + * every boost cycle.
> + *
> + * rcu_boost() only transfers the ownership of ->boost_mtx from now
> + * on, so that ->wait_lock is never rewritten while the task boosted
> + * in the previous cycle may still be inside rt_mutex_futex_unlock().
> + */
> + rt_mutex_init_proxy_locked(&rnp->boost_mtx.rtmutex, NULL);
> +
> raw_spin_lock_irqsave_rcu_node(rnp, flags);
> rnp->boost_kthread_task = t;
> raw_spin_unlock_irqrestore_rcu_node(rnp, flags);
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] rcu: Stop re-initializing ->boost_mtx on every boost cycle
2026-12-04 10:08 [PATCH] rcu: Stop re-initializing ->boost_mtx on every boost cycle Ziwei Dai
2026-12-04 18:46 ` Paul E. McKenney
@ 2026-12-05 9:55 ` kernel test robot
2026-12-05 9:55 ` kernel test robot
2 siblings, 0 replies; 4+ messages in thread
From: kernel test robot @ 2026-12-05 9:55 UTC (permalink / raw)
To: Ziwei Dai, rcu, linux-kernel
Cc: llvm, oe-kbuild-all, Paul E . McKenney, Frederic Weisbecker,
Neeraj Upadhyay, Joel Fernandes, Josh Triplett, Boqun Feng,
Uladzislau Rezki, Steven Rostedt, Mathieu Desnoyers,
Peter Zijlstra, Ingo Molnar, Will Deacon, Waiman Long,
Lai Jiangshan, Zqiang, lina.yang
Hi Ziwei,
kernel test robot noticed the following build warnings:
[auto build test WARNING on tip/locking/core]
[also build test WARNING on linus/master v7.4-rc5 next-20261203]
[cannot apply to rcu/rcu/dev]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Ziwei-Dai/rcu-Stop-re-initializing-boost_mtx-on-every-boost-cycle/20261204-180830
base: tip/locking/core
patch link: https://lore.kernel.org/r/20261204100830.226336-1-ziwei.dai%40unisoc.com
patch subject: [PATCH] rcu: Stop re-initializing ->boost_mtx on every boost cycle
config: um-x86_64_defconfig (https://download.01.org/0day-ci/archive/20261204/20261204223109.UDO9Isj1-lkp@intel.com/config)
compiler: clang version 24.0.0git (https://github.com/llvm/llvm-project 63b30c97f6082ebf34b31bdd81bb50df7672b67b)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261204/20261204223109.UDO9Isj1-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/20261204223109.UDO9Isj1-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> kernel/locking/rtmutex_api.c:329:2: warning: calling function 'rt_mutex_set_owner' requires holding raw_spinlock 'lock->wait_lock' exclusively [-Wthread-safety-analysis]
329 | rt_mutex_set_owner(lock, proxy_owner);
| ^
1 warning generated.
vim +329 kernel/locking/rtmutex_api.c
296
297 /**
298 * rt_mutex_boost_set_owner - make an initialized rt_mutex appear to be held
299 by @proxy_owner
300 * @lock: the rt_mutex, which must have been initialized already
301 * @proxy_owner: the task to set as owner
302 *
303 * No locking. Caller has to do serializing itself.
304 *
305 * Counterpart of rt_mutex_init_proxy_locked() for RCU priority boosting,
306 * which reuses a single, permanently embedded rt_mutex
307 * (rcu_node::boost_mtx) for every boost cycle. This performs exactly the
308 * same owner assignment, but deliberately does *not* re-initialize @lock
309 * and therefore does not rewrite lock->wait_lock.
310 *
311 * Re-initializing ->wait_lock is not possible once the mutex is in use.
312 * The task which was boosted in the previous cycle releases ->boost_mtx
313 * via rt_mutex_futex_unlock(), and it does so without holding the rcu_node
314 * lock. The ->owner = NULL store in that path happens while ->wait_lock
315 * is held, so the fast path of rt_mutex_lock() can already succeed at
316 * that point. Rewriting ->wait_lock from the boost kthread in this
317 * window lands on a spinlock which the other CPU still holds, which
318 * corrupts the lock word (on ARM32 ticket spinlocks the previous holder
319 * then trips "BUG: spinlock already unlocked") or, worse, lets two CPUs
320 * run inside the wait_lock protected section at the same time.
321 *
322 * Callers must initialize @lock once, up front, and use this function for
323 * every subsequent ownership transfer. @lock must be free and have no
324 * waiters queued when this is called.
325 */
326 void __sched rt_mutex_boost_set_owner(struct rt_mutex_base *lock,
327 struct task_struct *proxy_owner)
328 {
> 329 rt_mutex_set_owner(lock, proxy_owner);
330 }
331
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] rcu: Stop re-initializing ->boost_mtx on every boost cycle
2026-12-04 10:08 [PATCH] rcu: Stop re-initializing ->boost_mtx on every boost cycle Ziwei Dai
2026-12-04 18:46 ` Paul E. McKenney
2026-12-05 9:55 ` kernel test robot
@ 2026-12-05 9:55 ` kernel test robot
2 siblings, 0 replies; 4+ messages in thread
From: kernel test robot @ 2026-12-05 9:55 UTC (permalink / raw)
To: Ziwei Dai, rcu, linux-kernel
Cc: oe-kbuild-all, Paul E . McKenney, Frederic Weisbecker,
Neeraj Upadhyay, Joel Fernandes, Josh Triplett, Boqun Feng,
Uladzislau Rezki, Steven Rostedt, Mathieu Desnoyers,
Peter Zijlstra, Ingo Molnar, Will Deacon, Waiman Long,
Lai Jiangshan, Zqiang, lina.yang
Hi Ziwei,
kernel test robot noticed the following build warnings:
[auto build test WARNING on tip/locking/core]
[also build test WARNING on linus/master v7.4-rc5 next-20261203]
[cannot apply to rcu/rcu/dev]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Ziwei-Dai/rcu-Stop-re-initializing-boost_mtx-on-every-boost-cycle/20261204-180830
base: tip/locking/core
patch link: https://lore.kernel.org/r/20261204100830.226336-1-ziwei.dai%40unisoc.com
patch subject: [PATCH] rcu: Stop re-initializing ->boost_mtx on every boost cycle
config: x86_64-rhel-9.4 (https://download.01.org/0day-ci/archive/20261205/20261205023317.dh63GCN3-lkp@intel.com/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261205/20261205023317.dh63GCN3-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/20261205023317.dh63GCN3-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> Warning: kernel/locking/rtmutex_api.c:298 bad line: by @proxy_owner
>> Warning: kernel/locking/rtmutex_api.c:298 bad line: by @proxy_owner
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-12-05 9:56 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-04 10:08 [PATCH] rcu: Stop re-initializing ->boost_mtx on every boost cycle Ziwei Dai
2026-12-04 18:46 ` Paul E. McKenney
2026-12-05 9:55 ` kernel test robot
2026-12-05 9:55 ` kernel test robot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.