tree: https://gitee.com/openeuler/kernel.git OLK-5.10 head: 58f07869576fac9de85244333864fb34fb7df411 commit: 8802b2dc61376ea4727dba6630f81697da540e85 [3406/3406] task_work: add helper for more targeted task_work canceling config: arm64-randconfig-003-20251211 (https://download.01.org/0day-ci/archive/20251212/202512121309.G9fDOety-lkp@i...) compiler: aarch64-linux-gcc (GCC) 14.3.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251212/202512121309.G9fDOety-lkp@i...) 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/202512121309.G9fDOety-lkp@intel.com/ All warnings (new ones prefixed by >>):
kernel/task_work.c:84: warning: Function parameter or member 'data' not described in 'task_work_cancel_match'
vim +84 kernel/task_work.c e73f8959af0439d Oleg Nesterov 2012-05-11 71 892f6668f3a7088 Oleg Nesterov 2013-09-11 72 /** 8802b2dc61376ea Jens Axboe 2023-02-28 73 * task_work_cancel_match - cancel a pending work added by task_work_add() 892f6668f3a7088 Oleg Nesterov 2013-09-11 74 * @task: the task which should execute the work 8802b2dc61376ea Jens Axboe 2023-02-28 75 * @match: match function to call 892f6668f3a7088 Oleg Nesterov 2013-09-11 76 * 892f6668f3a7088 Oleg Nesterov 2013-09-11 77 * RETURNS: 892f6668f3a7088 Oleg Nesterov 2013-09-11 78 * The found work or NULL if not found. 892f6668f3a7088 Oleg Nesterov 2013-09-11 79 */ 67d1214551e800f Al Viro 2012-06-27 80 struct callback_head * 8802b2dc61376ea Jens Axboe 2023-02-28 81 task_work_cancel_match(struct task_struct *task, 8802b2dc61376ea Jens Axboe 2023-02-28 82 bool (*match)(struct callback_head *, void *data), 8802b2dc61376ea Jens Axboe 2023-02-28 83 void *data) e73f8959af0439d Oleg Nesterov 2012-05-11 @84 { ac3d0da8f3290b3 Oleg Nesterov 2012-08-26 85 struct callback_head **pprev = &task->task_works; 205e550a0fb469a Oleg Nesterov 2013-09-11 86 struct callback_head *work; e73f8959af0439d Oleg Nesterov 2012-05-11 87 unsigned long flags; 61e96496d3c9497 Oleg Nesterov 2016-08-02 88 61e96496d3c9497 Oleg Nesterov 2016-08-02 89 if (likely(!task->task_works)) 61e96496d3c9497 Oleg Nesterov 2016-08-02 90 return NULL; ac3d0da8f3290b3 Oleg Nesterov 2012-08-26 91 /* ac3d0da8f3290b3 Oleg Nesterov 2012-08-26 92 * If cmpxchg() fails we continue without updating pprev. ac3d0da8f3290b3 Oleg Nesterov 2012-08-26 93 * Either we raced with task_work_add() which added the ac3d0da8f3290b3 Oleg Nesterov 2012-08-26 94 * new entry before this work, we will find it again. Or 9da33de62431c78 Oleg Nesterov 2012-08-26 95 * we raced with task_work_run(), *pprev == NULL/exited. ac3d0da8f3290b3 Oleg Nesterov 2012-08-26 96 */ e73f8959af0439d Oleg Nesterov 2012-05-11 97 raw_spin_lock_irqsave(&task->pi_lock, flags); 506458efaf153c1 Will Deacon 2017-10-24 98 while ((work = READ_ONCE(*pprev))) { 8802b2dc61376ea Jens Axboe 2023-02-28 99 if (!match(work, data)) ac3d0da8f3290b3 Oleg Nesterov 2012-08-26 100 pprev = &work->next; ac3d0da8f3290b3 Oleg Nesterov 2012-08-26 101 else if (cmpxchg(pprev, work, work->next) == work) 158e1645e07f3e9 Al Viro 2012-06-27 102 break; 158e1645e07f3e9 Al Viro 2012-06-27 103 } e73f8959af0439d Oleg Nesterov 2012-05-11 104 raw_spin_unlock_irqrestore(&task->pi_lock, flags); ac3d0da8f3290b3 Oleg Nesterov 2012-08-26 105 ac3d0da8f3290b3 Oleg Nesterov 2012-08-26 106 return work; e73f8959af0439d Oleg Nesterov 2012-05-11 107 } e73f8959af0439d Oleg Nesterov 2012-05-11 108 :::::: The code at line 84 was first introduced by commit :::::: e73f8959af0439d114847eab5a8a5ce48f1217c4 task_work_add: generic process-context callbacks :::::: TO: Oleg Nesterov <oleg@redhat.com> :::::: CC: Al Viro <viro@zeniv.linux.org.uk> -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki