[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250423125341.503659-1-jiayuan.chen@linux.dev>
Date: Wed, 23 Apr 2025 20:53:41 +0800
From: Jiayuan Chen <jiayuan.chen@...ux.dev>
To: linux-kernel@...r.kernel.org
Cc: mrpre@....com,
mkoutny@...e.com,
Jiayuan Chen <jiayuan.chen@...ux.dev>,
syzbot+01affb1491750534256d@...kaller.appspotmail.com,
Tejun Heo <tj@...nel.org>,
Lai Jiangshan <jiangshanlai@...il.com>
Subject: [PATCH v1] workqueue: annotate data-races around pwq->stats
Suppress warning by annotating these accesses using
READ_ONCE() / WRITE_ONCE().
Reported-by: syzbot+01affb1491750534256d@...kaller.appspotmail.com
Signed-off-by: Jiayuan Chen <jiayuan.chen@...ux.dev>
---
kernel/workqueue.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index cf6203282737..d78640b5d188 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -3241,7 +3241,7 @@ __acquires(&pool->lock)
* point will only record its address.
*/
trace_workqueue_execute_end(work, worker->current_func);
- pwq->stats[PWQ_STAT_COMPLETED]++;
+ WRITE_ONCE(pwq->stats[PWQ_STAT_COMPLETED], READ_ONCE(pwq->stats[PWQ_STAT_COMPLETED]) + 1);
lock_map_release(&lockdep_map);
if (!bh_draining)
lock_map_release(pwq->wq->lockdep_map);
--
2.47.1
Powered by blists - more mailing lists