From: kernel test robot <lkp@intel.com>
To: Edward Adam Davis <eadavis@sina.com>,
syzbot+97fde463a8ffb9e839d2@syzkaller.appspotmail.com
Cc: oe-kbuild-all@lists.linux.dev, tj@kernel.org,
jiangshanlai@gmail.com, linux-kernel@vger.kernel.org,
syzkaller-bugs@googlegroups.com
Subject: Re: [PATCH] workqueue: Avoid noise generated by real-time tasks
Date: Sun, 29 Nov 2026 23:46:27 +0100 [thread overview]
Message-ID: <20261129234130.on7LtRsQ-lkp@intel.com> (raw)
In-Reply-To: <20261126102530.37205-1-eadavis@sina.com>
Hi Edward,
kernel test robot noticed the following build warnings:
[auto build test WARNING on tj-wq/for-next]
[also build test WARNING on linus/master v7.4-rc4 next-20261127]
[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/Edward-Adam-Davis/workqueue-Avoid-noise-generated-by-real-time-tasks/20261126-182530
base: https://git.kernel.org/pub/scm/linux/kernel/git/tj/wq.git for-next
patch link: https://lore.kernel.org/r/20261126102530.37205-1-eadavis%40sina.com
patch subject: [PATCH] workqueue: Avoid noise generated by real-time tasks
config: powerpc64-randconfig-r2301-20261129 (https://download.01.org/0day-ci/archive/20261129/20261129234130.on7LtRsQ-lkp@intel.com/config)
compiler: powerpc64-linux-gcc (GCC) 10.5.0
sparse: v0.6.5-rc1-21-g84ec0658
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261129/20261129234130.on7LtRsQ-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/20261129234130.on7LtRsQ-lkp@intel.com/
sparse warnings: (new ones prefixed by >>)
>> kernel/workqueue.c:8319:27: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct task_struct *p @@ got struct task_struct [noderef] __rcu * @@
kernel/workqueue.c:8319:27: sparse: expected struct task_struct *p
kernel/workqueue.c:8319:27: sparse: got struct task_struct [noderef] __rcu *
vim +8319 kernel/workqueue.c
8254
8255 static void wq_watchdog_timer_fn(struct timer_list *unused)
8256 {
8257 unsigned long thresh = READ_ONCE(wq_watchdog_thresh) * HZ;
8258 unsigned int max_stall_time = 0;
8259 bool lockup_detected = false;
8260 bool cpu_pool_stall = false;
8261 unsigned long now = jiffies;
8262 struct worker_pool *pool;
8263 unsigned int stall_time;
8264 int pi;
8265
8266 if (!thresh)
8267 return;
8268
8269 for_each_pool(pool, pi) {
8270 unsigned long pool_ts, touched, ts;
8271
8272 pool->cpu_stall = false;
8273 if (list_empty(&pool->worklist))
8274 continue;
8275
8276 /*
8277 * If a virtual machine is stopped by the host it can look to
8278 * the watchdog like a stall.
8279 */
8280 kvm_check_and_clear_guest_paused();
8281
8282 /* get the latest of pool and touched timestamps */
8283 if (pool->cpu >= 0)
8284 touched = READ_ONCE(per_cpu(wq_watchdog_touched_cpu, pool->cpu));
8285 else
8286 touched = READ_ONCE(wq_watchdog_touched);
8287 pool_ts = READ_ONCE(pool->last_progress_ts);
8288
8289 if (time_after(pool_ts, touched))
8290 ts = pool_ts;
8291 else
8292 ts = touched;
8293
8294 /*
8295 * Did we stall?
8296 *
8297 * Do a lockless check first to do not disturb the system.
8298 *
8299 * Prevent false positives by double checking the timestamp
8300 * under pool->lock. The lock makes sure that the check reads
8301 * an updated pool->last_progress_ts when this CPU saw
8302 * an already updated pool->worklist above. It seems better
8303 * than adding another barrier into __queue_work() which
8304 * is a hotter path.
8305 */
8306 if (time_after(now, ts + thresh)) {
8307 struct task_struct *p;
8308
8309 scoped_guard(raw_spinlock_irqsave, &pool->lock) {
8310 pool_ts = pool->last_progress_ts;
8311 if (time_after(pool_ts, touched))
8312 ts = pool_ts;
8313 else
8314 ts = touched;
8315 }
8316 if (!time_after(now, ts + thresh))
8317 continue;
8318
> 8319 p = pool->cpu >= 0 ? cpu_curr(pool->cpu) : NULL;
8320 if (p && (p->policy == SCHED_FIFO ||
8321 p->policy == SCHED_RR))
8322 continue;
8323
8324 lockup_detected = true;
8325 stall_time = jiffies_to_msecs(now - pool_ts) / 1000;
8326 max_stall_time = max(max_stall_time, stall_time);
8327 if (is_percpu_pool(pool) && !(pool->flags & POOL_BH)) {
8328 pool->cpu_stall = true;
8329 cpu_pool_stall = true;
8330 }
8331 pr_emerg("BUG: workqueue lockup - pool");
8332 pr_cont_pool_info(pool);
8333 pr_cont(" stuck for %us!\n", stall_time);
8334 }
8335 }
8336
8337 if (lockup_detected)
8338 show_all_workqueues();
8339
8340 if (cpu_pool_stall)
8341 show_cpu_pools_busy_workers();
8342
8343 if (lockup_detected)
8344 panic_on_wq_watchdog(max_stall_time);
8345
8346 wq_watchdog_reset_touched();
8347 mod_timer(&wq_watchdog_timer, jiffies + thresh);
8348 }
8349
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
prev parent reply other threads:[~2026-11-29 22:47 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-24 11:36 [syzbot] [ext4?] BUG: workqueue lockup in update_super_work syzbot
2026-11-25 0:53 ` Hillf Danton
2026-11-26 10:25 ` [PATCH] workqueue: Avoid noise generated by real-time tasks Edward Adam Davis
2026-11-26 10:57 ` Tejun Heo
2026-11-27 5:07 ` Edward Adam Davis
2026-11-27 5:40 ` [PATCH next v2] workqueue: Avoid noise generated by userspace realtime tasks Edward Adam Davis
2026-11-29 22:46 ` kernel test robot [this message]
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=20261129234130.on7LtRsQ-lkp@intel.com \
--to=lkp@intel.com \
--cc=eadavis@sina.com \
--cc=jiangshanlai@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=syzbot+97fde463a8ffb9e839d2@syzkaller.appspotmail.com \
--cc=syzkaller-bugs@googlegroups.com \
--cc=tj@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®