From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=202.108.3.25 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795688745; b=OlYJwPIkogft2jTdY2j2wCCE+/4l5nlAdFw6hNdQw1tXRinjHCLFtxyQb/BR4/GkY7QX NY5R1B0WxMDSV3Uf0K5y6f1EFGrmD6Di6B4aw8gM0nzdyDvPpOp0C/6J0QQ7i+JLMx2AU ME9k47uI9rwJ8v7EpFbltc0htZnz6tiEsOL48N7yZZkUJYjWFZ2CF8AqmC+ugqcyzB2l5 UwYrmMTrCChZ+F+x01iB1/fCst5en6iMtMQI/LL5pMSbMVa4bEYqpW6fYZIm61sD2ZIDJ Gb8dl+l5GK3Nu+uVfTOR5mAU7HzYsq1l8p4juTfRoKhXlrwwgi9TV3PBc1G4fpvaDtw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795688745; h=DMARC-Filter:DKIM-Signature:X-SMAIL-HELO:Received:X-Sender:X-Auth-ID: X-SMAIL-MID:X-SMAIL-UIID:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:MIME-Version:Content-Transfer-Encoding; bh=jthhRIKqLsrI5bidwrGNOrDnDu8pY167/Ro8kEMZrKg=; b=1ts9I1a4e0twv237xf2GENysXbMU1c8j2lnL2l/FdMwm9dQJwSKICXpKkX9/BMad4tNr F4028oLyjyE++hVEsaZT1sn8dUiJ9627xYkQdQG/XG1llEEYpXiqAXMc3B4WCH36a/tLG PyMJxoNKXY7zN4LfnYZdaRrvyaDRKoU4f9nun77gVoOke++dcpe55BrNT8OLGEfT57ZFV +QxdpGShXIhtJGl5Dr54Fo+ohrgyGQPl10vLpliTVmp6hlH3IXz+hge1MbNePGIE5PwIT iN0od1wZkWAXC3LXKwRxPQXNQD8kYPC3wYSYtwQspIZT9jlAW/HHKYPDNJv//teVIpw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=sina.com; spf=pass smtp.mailfrom=sina.com; dkim=pass header.d=sina.com header.i=@sina.com header.a=rsa-sha256 header.s=201208 header.b=0BOaysNu; arc=none smtp.remote-ip=202.108.3.25 Received: from r3-25.sinamail.sina.com.cn (r3-25.sinamail.sina.com.cn [202.108.3.25]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 85C8C606A31E for ; Thu, 26 Nov 2026 10:25:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 85C8C606A31E Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sina.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sina.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=sina.com header.i=@sina.com header.a=rsa-sha256 header.s=201208 header.b=0BOaysNu DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sina.com; s=201208; t=1795688743; bh=jthhRIKqLsrI5bidwrGNOrDnDu8pY167/Ro8kEMZrKg=; h=From:Subject:Date:Message-ID; b=0BOaysNuf75afR82rE9i2FZAgFXukdslFRxkSUwmulBjBU8f3UzA6dxyskXhcmHxn azt/chOSHHPybR8tRccyd+hwySXH4wnQQImv8OGWk/zI+9GHtkj9SEfd5G4UclA/XC 7Ou7z57udGTcd9kwlSiwSKUC/x2HZgIBZFMC8WVY= X-SMAIL-HELO: lxu-pcd Received: from unknown (HELO lxu-pcd)([111.198.225.163]) by sina.com (10.54.253.31) with ESMTP id 6B08091A0000565B; Thu, 26 Nov 2026 18:25:34 +0800 (CST) X-Sender: eadavis@sina.com X-Auth-ID: eadavis@sina.com Authentication-Results: sina.com; spf=none smtp.mailfrom=eadavis@sina.com; dkim=none header.i=none; dmarc=none action=none header.from=eadavis@sina.com X-SMAIL-MID: 3359536815936 X-SMAIL-UIID: A9910DC47D25456C85CF816111D3448D-20261126-182534-1 From: Edward Adam Davis To: syzbot+97fde463a8ffb9e839d2@syzkaller.appspotmail.com Cc: tj@kernel.org, jiangshanlai@gmail.com, linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com Subject: [PATCH] workqueue: Avoid noise generated by real-time tasks Date: Thu, 26 Nov 2026 18:25:30 +0800 Message-ID: <20261126102530.37205-1-eadavis@sina.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <6b0576ba.a481e175.27cf24.0027.GAE@google.com> References: <6b0576ba.a481e175.27cf24.0027.GAE@google.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit A user creates a SCHED_FIFO real-time thread and pins it to CPU0, and arm watchdog timer on CPU1 with 3s threshold. The real-time thread runs for an extended period without voluntarily yielding the CPU, preventing standard kworker threads on CPU0 from gaining access to the processor. As a result, certain kernel works cannot be executed in a timely manner, which may even trigger a watchdog report: BUG: workqueue lockup - pool cpus=0 node=0 flags=0x0 nice=0 stuck for 5s! Showing busy workqueues and worker pools: workqueue mm_percpu_wq: flags=0x108 pwq 2: cpus=0 node=0 flags=0x0 nice=0 active=1 refcnt=2 pending: vmstat_update To address this, a check for CPU-bound tasks has been added to the work pool; this helps prevent false-positive reports caused by prolonged CPU occupancy by real-time tasks. Fixes: 82607adcf9cd ("workqueue: implement lockup detector") Reported-by: syzbot+97fde463a8ffb9e839d2@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=97fde463a8ffb9e839d2 Signed-off-by: Edward Adam Davis --- kernel/workqueue.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/kernel/workqueue.c b/kernel/workqueue.c index af845214e78b..daf7aad79062 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -52,6 +52,7 @@ #include #include #include +#include #include #include #include @@ -8202,6 +8203,8 @@ static void wq_watchdog_timer_fn(struct timer_list *unused) * is a hotter path. */ if (time_after(now, ts + thresh)) { + struct task_struct *p; + scoped_guard(raw_spinlock_irqsave, &pool->lock) { pool_ts = pool->last_progress_ts; if (time_after(pool_ts, touched)) @@ -8212,6 +8215,11 @@ static void wq_watchdog_timer_fn(struct timer_list *unused) if (!time_after(now, ts + thresh)) continue; + p = pool->cpu >= 0 ? cpu_curr(pool->cpu) : NULL; + if (p && (p->policy == SCHED_FIFO || + p->policy == SCHED_RR)) + continue; + lockup_detected = true; stall_time = jiffies_to_msecs(now - pool_ts) / 1000; max_stall_time = max(max_stall_time, stall_time); -- 2.43.0