Thread (44 messages) 44 messages, 1 author, 2025-07-25
STALE329d
Revisions (11)
  1. v10 [diff vs current]
  2. v10 [diff vs current]
  3. v10 [diff vs current]
  4. v11 [diff vs current]
  5. v12 [diff vs current]
  6. v13 [diff vs current]
  7. v14 [diff vs current]
  8. v15 [diff vs current]
  9. v16 current
  10. v17 [diff vs current]
  11. v18 [diff vs current]

[PATCH v16 10/42] dept: distinguish each work from another

From: Byungchul Park <byungchul@sk.com>
Date: 2025-05-19 09:18:44
Also in: dri-devel, linux-block, linux-ext4, linux-fsdevel, linux-ide, linux-mm, lkml
Subsystem: the rest, workqueue · Maintainers: Linus Torvalds, Tejun Heo

Workqueue already provides concurrency control.  By that, any wait in a
work doesn't prevents events in other works with the control enabled.
Thus, each work would better be considered a different context.

So let dept assign a different context id to each work.

Signed-off-by: Byungchul Park <byungchul@sk.com>
---
 kernel/workqueue.c | 3 +++
 1 file changed, 3 insertions(+)
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index cf6203282737..5a6ab354c416 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -55,6 +55,7 @@
 #include <linux/kvm_para.h>
 #include <linux/delay.h>
 #include <linux/irq_work.h>
+#include <linux/dept.h>
 
 #include "workqueue_internal.h"
 
@@ -3155,6 +3156,8 @@ __acquires(&pool->lock)
 
 	lockdep_copy_map(&lockdep_map, &work->lockdep_map);
 #endif
+	dept_update_cxt();
+
 	/* ensure we're on the correct CPU */
 	WARN_ON_ONCE(!(pool->flags & POOL_DISASSOCIATED) &&
 		     raw_smp_processor_id() != pool->cpu);
-- 
2.17.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help