Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
* Re: [PATCH] rcu: Stop re-initializing ->boost_mtx on every boost cycle
       [not found] <20261204100830.226336-1-ziwei.dai@unisoc.com>
@ 2026-12-05  9:55 ` kernel test robot
  0 siblings, 0 replies; only message 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] only message in thread

only message in thread, other threads:[~2026-12-05  9:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20261204100830.226336-1-ziwei.dai@unisoc.com>
2026-12-05  9:55 ` [PATCH] rcu: Stop re-initializing ->boost_mtx on every boost cycle kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox