Re: [PATCH] kthread: Teach lockdep about kthread_flush_work() dependencies
From: kernel test robot
Date: Wed Oct 21 2026 - 03:42:42 EST
Hi David,
kernel test robot noticed the following build warnings:
[auto build test WARNING on chrome-platform/for-next]
[also build test WARNING on chrome-platform/for-firmware-next linus/master v7.3 next-20261019]
[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/David-Woodhouse/kthread-Teach-lockdep-about-kthread_flush_work-dependencies/20261020-160400
base: https://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux.git for-next
patch link: https://lore.kernel.org/r/6dee36e290c2a3b85dcd7cdba2cab72fe57b25c4.camel%40infradead.org
patch subject: [PATCH] kthread: Teach lockdep about kthread_flush_work() dependencies
config: arm64-allnoconfig (https://download.01.org/0day-ci/archive/20261021/202610211501.YBj5GUfA-lkp@xxxxxxxxx/config)
compiler: aarch64-linux-gcc (GCC) 16.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261021/202610211501.YBj5GUfA-lkp@xxxxxxxxx/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@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202610211501.YBj5GUfA-lkp@xxxxxxxxx/
All warnings (new ones prefixed by >>):
In file included from kernel/rcu/tree.c:45:
kernel/rcu/tree_exp.h: In function 'sync_rcu_exp_select_cpus_queue_work':
>> include/linux/kthread.h:219:46: warning: unused variable '__work_key' [-Wunused-variable]
219 | static struct lock_class_key __work_key; \
| ^~~~~~~~~~
kernel/rcu/tree_exp.h:470:9: note: in expansion of macro 'kthread_init_work'
470 | kthread_init_work(&rnp->rew.rew_work, sync_rcu_exp_select_node_cpus);
| ^~~~~~~~~~~~~~~~~
kernel/rcu/tree_exp.h: In function 'synchronize_rcu_expedited_queue_work':
>> include/linux/kthread.h:219:46: warning: unused variable '__work_key' [-Wunused-variable]
219 | static struct lock_class_key __work_key; \
| ^~~~~~~~~~
kernel/rcu/tree_exp.h:497:9: note: in expansion of macro 'kthread_init_work'
497 | kthread_init_work(&rew->rew_work, wait_rcu_exp_gp);
| ^~~~~~~~~~~~~~~~~
vim +/__work_key +219 include/linux/kthread.h
216
217 #define kthread_init_work(work, fn) \
218 do { \
> 219 static struct lock_class_key __work_key; \
220 memset((work), 0, sizeof(struct kthread_work)); \
221 INIT_LIST_HEAD(&(work)->node); \
222 (work)->func = (fn); \
223 __kthread_init_work_lockdep_map((work), &__work_key); \
224 } while (0)
225
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki