All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev
Subject: [peterz-queue:locking/core 10/10] kernel/futex/core.c:982:1: warning: spinlock 'atomic ? __u.__val : q->lock_ptr' is still held at the end of function
Date: Thu, 22 Jan 2026 10:30:28 +0800	[thread overview]
Message-ID: <202601221040.TeM0ihff-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git locking/core
head:   33d9e7fdf9c17417347d1f06ddebaf25f21ab62a
commit: 33d9e7fdf9c17417347d1f06ddebaf25f21ab62a [10/10] futex: Convert to compiler context analysis
config: arm64-randconfig-001-20260122 (https://download.01.org/0day-ci/archive/20260122/202601221040.TeM0ihff-lkp@intel.com/config)
compiler: clang version 22.0.0git (https://github.com/llvm/llvm-project 9b8addffa70cee5b2acc5454712d9cf78ce45710)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260122/202601221040.TeM0ihff-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/202601221040.TeM0ihff-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> kernel/futex/core.c:982:1: warning: spinlock 'atomic ? __u.__val : q->lock_ptr' is still held at the end of function [-Wthread-safety-analysis]
     982 | }
         | ^
   kernel/futex/core.c:976:2: note: spinlock acquired here
     976 |         spin_lock(lock_ptr);
         |         ^
>> kernel/futex/core.c:982:1: warning: expecting spinlock 'q->lock_ptr' to be held at the end of function [-Wthread-safety-analysis]
     982 | }
         | ^
   kernel/futex/core.c:966:6: note: spinlock acquired here
     966 | void futex_q_lockptr_lock(struct futex_q *q)
         |      ^
   2 warnings generated.


vim +982 kernel/futex/core.c

c1e2f0eaf015fb kernel/futex.c      Peter Zijlstra            2017-12-08  965  
b04b8f3032aae6 kernel/futex/core.c Sebastian Andrzej Siewior 2025-04-16  966  void futex_q_lockptr_lock(struct futex_q *q)
b04b8f3032aae6 kernel/futex/core.c Sebastian Andrzej Siewior 2025-04-16  967  {
b04b8f3032aae6 kernel/futex/core.c Sebastian Andrzej Siewior 2025-04-16  968  	spinlock_t *lock_ptr;
b04b8f3032aae6 kernel/futex/core.c Sebastian Andrzej Siewior 2025-04-16  969  
b04b8f3032aae6 kernel/futex/core.c Sebastian Andrzej Siewior 2025-04-16  970  	/*
b04b8f3032aae6 kernel/futex/core.c Sebastian Andrzej Siewior 2025-04-16  971  	 * See futex_unqueue() why lock_ptr can change.
b04b8f3032aae6 kernel/futex/core.c Sebastian Andrzej Siewior 2025-04-16  972  	 */
b04b8f3032aae6 kernel/futex/core.c Sebastian Andrzej Siewior 2025-04-16  973  	guard(rcu)();
b04b8f3032aae6 kernel/futex/core.c Sebastian Andrzej Siewior 2025-04-16  974  retry:
b04b8f3032aae6 kernel/futex/core.c Sebastian Andrzej Siewior 2025-04-16  975  	lock_ptr = READ_ONCE(q->lock_ptr);
b04b8f3032aae6 kernel/futex/core.c Sebastian Andrzej Siewior 2025-04-16  976  	spin_lock(lock_ptr);
b04b8f3032aae6 kernel/futex/core.c Sebastian Andrzej Siewior 2025-04-16  977  
b04b8f3032aae6 kernel/futex/core.c Sebastian Andrzej Siewior 2025-04-16  978  	if (unlikely(lock_ptr != q->lock_ptr)) {
b04b8f3032aae6 kernel/futex/core.c Sebastian Andrzej Siewior 2025-04-16  979  		spin_unlock(lock_ptr);
b04b8f3032aae6 kernel/futex/core.c Sebastian Andrzej Siewior 2025-04-16  980  		goto retry;
b04b8f3032aae6 kernel/futex/core.c Sebastian Andrzej Siewior 2025-04-16  981  	}
b04b8f3032aae6 kernel/futex/core.c Sebastian Andrzej Siewior 2025-04-16 @982  }
b04b8f3032aae6 kernel/futex/core.c Sebastian Andrzej Siewior 2025-04-16  983  

:::::: The code at line 982 was first introduced by commit
:::::: b04b8f3032aae6121303bfa324c768faba032242 futex: Introduce futex_q_lockptr_lock()

:::::: TO: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
:::::: CC: Peter Zijlstra <peterz@infradead.org>

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

             reply	other threads:[~2026-01-22  2:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-22  2:30 kernel test robot [this message]
2026-01-22  9:16 ` [peterz-queue:locking/core 10/10] kernel/futex/core.c:982:1: warning: spinlock 'atomic ? __u.__val : q->lock_ptr' is still held at the end of function Peter Zijlstra
2026-01-22 18:31   ` Marco Elver
2026-01-23  8:55     ` Peter Zijlstra
2026-01-23 14:37       ` Marco Elver

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202601221040.TeM0ihff-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=llvm@lists.linux.dev \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=peterz@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.