When a singlethread thread is added on the list, it is
appended to the first cpu workqueues. This is a mistake because
singlethreaded workqueues are not bounded to specific cpu but
on all online cpus.
On their cpu column, we will now find a * character.
# CPU INSERTED EXECUTED NAME
# | | | |
* 0 0 kpsmoused
* 0 0 ata_aux
* 0 0 cqueue
* 0 0 kacpi_notify
* 0 0 kacpid
* 998 998 khelper
* 0 0 cpuset
1 0 0 hda0/1
1 42 42 reiserfs/1
1 0 0 scsi_tgtd/1
1 0 0 aio/1
1 0 0 ata/1
1 193 193 kblockd/1
1 0 0 kintegrityd/1
1 4 4 work_on_cpu/1
1 1244 1244 events/1
0 0 0 hda0/0
0 63 63 reiserfs/0
0 0 0 scsi_tgtd/0
0 0 0 aio/0
0 0 0 ata/0
0 188 188 kblockd/0
0 0 0 kintegrityd/0
0 16 16 work_on_cpu/0
0 1360 1360 events/0
Hmm, it looks like most of these workqueues are pointless :-)
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
---
include/trace/workqueue.h | 16 +++--
kernel/trace/trace_workqueue.c | 143 +++++++++++++++++++++++++++-------------
kernel/workqueue.c | 11 ++-
3 files changed, 115 insertions(+), 55 deletions(-)
diff --git a/include/trace/workqueue.h b/include/trace/workqueue.h
index 867829d..4769c2d 100644
--- a/include/trace/workqueue.h
+++ b/include/trace/workqueue.h
@@ -5,13 +5,17 @@
#include <linux/workqueue.h>
#include <linux/sched.h>
+#define SINGLETHREAD_CPU -1
+
DECLARE_TRACE(workqueue_insertion,
- TPPROTO(struct task_struct *wq_thread, struct work_struct *work),
- ...