* [PATCH 0/3] workqueue: Fix table in wq_dump.py for large number of workqueues
@ 2026-03-07 17:47 Breno Leitao
2026-03-07 17:47 ` [PATCH 1/3] tools/workqueue/wq_dump.py: remove backslash separator from node_nr/max_active header Breno Leitao
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Breno Leitao @ 2026-03-07 17:47 UTC (permalink / raw)
To: tj, jiangshanlai; +Cc: linux-kernel, Breno Leitao, kernel-team
On larger machines (e.g. 316 CPUs, 2 NUMA nodes), the "Unbound
workqueue -> node_nr/max_active" section of wq_dump.py has column
alignment issues.
Values like max_active=2048 exceed the hardcoded minimum field width of 3,
causing the header and data rows to misalign.
This series cleans up the formatting:
1. Remove the backslash separator from the header
2. Widen format specifiers for 4-digit values and right-align
nr/max as a single string
3. Add "NODE" prefix to all node columns for clarity.
* Although the original code intentionally only labeled the first column,
the bare numbers for subsequent nodes create more confusion than they
help. Labeling all columns makes the output self-explanatory.
Before:
[ workqueue \ min max NODE 0 1 dfl ]
events_unbound 8 2048 0/2048 0/ 8 0/2048
netns 1 1 0/ 1 0/ 1 0/ 1
async 1024 1024 0/1024 0/1024 0/1024
cpuset_migrate_mm 1 1 0/ 1 0/ 1 0/ 1
After:
[ workqueue min max NODE 0 NODE 1 dfl ]
events_unbound 8 2048 0/2048 0/8 0/2048
netns 1 1 0/1 0/1 0/1
async 1024 1024 0/1024 0/1024 0/1024
cpuset_migrate_mm 1 1 0/1 0/1 0/1
Signed-off-by: Breno Leitao <leitao@debian.org>
---
Breno Leitao (3):
tools/workqueue/wq_dump.py: remove backslash separator from node_nr/max_active header
tools/workqueue/wq_dump.py: fix column alignment in node_nr/max_active section
tools/workqueue/wq_dump.py: add NODE prefix to all node columns
tools/workqueue/wq_dump.py | 17 ++++++-----------
1 file changed, 6 insertions(+), 11 deletions(-)
---
base-commit: 5ee8dbf54602dc340d6235b1d6aa17c0f283f48c
change-id: 20260307-wqdump-33fd85802b92
Best regards,
--
Breno Leitao <leitao@debian.org>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/3] tools/workqueue/wq_dump.py: remove backslash separator from node_nr/max_active header
2026-03-07 17:47 [PATCH 0/3] workqueue: Fix table in wq_dump.py for large number of workqueues Breno Leitao
@ 2026-03-07 17:47 ` Breno Leitao
2026-03-07 17:47 ` [PATCH 2/3] tools/workqueue/wq_dump.py: fix column alignment in node_nr/max_active section Breno Leitao
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Breno Leitao @ 2026-03-07 17:47 UTC (permalink / raw)
To: tj, jiangshanlai; +Cc: linux-kernel, Breno Leitao, kernel-team
Remove the backslash separator between the workqueue name and the
data columns in the "Unbound workqueue -> node_nr/max_active" header
for cleaner output.
Signed-off-by: Breno Leitao <leitao@debian.org>
---
tools/workqueue/wq_dump.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/workqueue/wq_dump.py b/tools/workqueue/wq_dump.py
index d29b918306b48..2079e98f77e4e 100644
--- a/tools/workqueue/wq_dump.py
+++ b/tools/workqueue/wq_dump.py
@@ -227,7 +227,7 @@ if 'node_to_cpumask_map' in prog:
print(f'NODE[{node:02}]={cpumask_str(node_to_cpumask_map[node])}')
print('')
- print(f'[{"workqueue":^{WQ_NAME_LEN-2}}\\ min max', end='')
+ print(f'[{"workqueue":^{WQ_NAME_LEN-1}} min max', end='')
first = True
for node in for_each_node():
if first:
--
2.47.3
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 2/3] tools/workqueue/wq_dump.py: fix column alignment in node_nr/max_active section
2026-03-07 17:47 [PATCH 0/3] workqueue: Fix table in wq_dump.py for large number of workqueues Breno Leitao
2026-03-07 17:47 ` [PATCH 1/3] tools/workqueue/wq_dump.py: remove backslash separator from node_nr/max_active header Breno Leitao
@ 2026-03-07 17:47 ` Breno Leitao
2026-03-07 17:47 ` [PATCH 3/3] tools/workqueue/wq_dump.py: add NODE prefix to all node columns Breno Leitao
2026-03-07 18:17 ` [PATCH 0/3] workqueue: Fix table in wq_dump.py for large number of workqueues Tejun Heo
3 siblings, 0 replies; 5+ messages in thread
From: Breno Leitao @ 2026-03-07 17:47 UTC (permalink / raw)
To: tj, jiangshanlai; +Cc: linux-kernel, Breno Leitao, kernel-team
On larger machines with many CPUs, max_active values such as 2048
exceed the hardcoded minimum field width of 3 characters, causing the
header and data columns to misalign.
Widen the format specifiers to accommodate 4-digit values and
right-align each nr/max as a single string to keep the output compact.
Signed-off-by: Breno Leitao <leitao@debian.org>
---
tools/workqueue/wq_dump.py | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/tools/workqueue/wq_dump.py b/tools/workqueue/wq_dump.py
index 2079e98f77e4e..bddfeb9fc2a8e 100644
--- a/tools/workqueue/wq_dump.py
+++ b/tools/workqueue/wq_dump.py
@@ -227,15 +227,15 @@ if 'node_to_cpumask_map' in prog:
print(f'NODE[{node:02}]={cpumask_str(node_to_cpumask_map[node])}')
print('')
- print(f'[{"workqueue":^{WQ_NAME_LEN-1}} min max', end='')
+ print(f'[{"workqueue":^{WQ_NAME_LEN-1}} {"min":>4} {"max":>4}', end='')
first = True
for node in for_each_node():
if first:
- print(f' NODE {node}', end='')
+ print(f' {"NODE " + str(node):>8}', end='')
first = False
else:
- print(f' {node:7}', end='')
- print(f' {"dfl":>7} ]')
+ print(f' {node:>9}', end='')
+ print(f' {"dfl":>9} ]')
print('')
for wq in list_for_each_entry('struct workqueue_struct', workqueues.address_of_(), 'list'):
@@ -243,11 +243,11 @@ if 'node_to_cpumask_map' in prog:
continue
print(f'{wq.name.string_().decode():{WQ_NAME_LEN}} ', end='')
- print(f'{wq.min_active.value_():3} {wq.max_active.value_():3}', end='')
+ print(f'{wq.min_active.value_():4} {wq.max_active.value_():4}', end='')
for node in for_each_node():
nna = wq.node_nr_active[node]
- print(f' {nna.nr.counter.value_():3}/{nna.max.value_():3}', end='')
+ print(f' {f"{nna.nr.counter.value_()}/{nna.max.value_()}":>9}', end='')
nna = wq.node_nr_active[nr_node_ids]
- print(f' {nna.nr.counter.value_():3}/{nna.max.value_():3}')
+ print(f' {f"{nna.nr.counter.value_()}/{nna.max.value_()}":>9}')
else:
printf(f'node_to_cpumask_map not present, is NUMA enabled?')
--
2.47.3
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 3/3] tools/workqueue/wq_dump.py: add NODE prefix to all node columns
2026-03-07 17:47 [PATCH 0/3] workqueue: Fix table in wq_dump.py for large number of workqueues Breno Leitao
2026-03-07 17:47 ` [PATCH 1/3] tools/workqueue/wq_dump.py: remove backslash separator from node_nr/max_active header Breno Leitao
2026-03-07 17:47 ` [PATCH 2/3] tools/workqueue/wq_dump.py: fix column alignment in node_nr/max_active section Breno Leitao
@ 2026-03-07 17:47 ` Breno Leitao
2026-03-07 18:17 ` [PATCH 0/3] workqueue: Fix table in wq_dump.py for large number of workqueues Tejun Heo
3 siblings, 0 replies; 5+ messages in thread
From: Breno Leitao @ 2026-03-07 17:47 UTC (permalink / raw)
To: tj, jiangshanlai; +Cc: linux-kernel, Breno Leitao, kernel-team
Previously only the first node column showed "NODE 0" while subsequent
columns showed just the bare node number, making it unclear what the
numbers refer to.
Add the "NODE" prefix to all node columns and remove the now-unnecessary
first/else branching.
Signed-off-by: Breno Leitao <leitao@debian.org>
---
tools/workqueue/wq_dump.py | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/tools/workqueue/wq_dump.py b/tools/workqueue/wq_dump.py
index bddfeb9fc2a8e..fb3b87aa40cf8 100644
--- a/tools/workqueue/wq_dump.py
+++ b/tools/workqueue/wq_dump.py
@@ -228,13 +228,8 @@ if 'node_to_cpumask_map' in prog:
print('')
print(f'[{"workqueue":^{WQ_NAME_LEN-1}} {"min":>4} {"max":>4}', end='')
- first = True
for node in for_each_node():
- if first:
- print(f' {"NODE " + str(node):>8}', end='')
- first = False
- else:
- print(f' {node:>9}', end='')
+ print(f' {"NODE " + str(node):>9}', end='')
print(f' {"dfl":>9} ]')
print('')
--
2.47.3
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 0/3] workqueue: Fix table in wq_dump.py for large number of workqueues
2026-03-07 17:47 [PATCH 0/3] workqueue: Fix table in wq_dump.py for large number of workqueues Breno Leitao
` (2 preceding siblings ...)
2026-03-07 17:47 ` [PATCH 3/3] tools/workqueue/wq_dump.py: add NODE prefix to all node columns Breno Leitao
@ 2026-03-07 18:17 ` Tejun Heo
3 siblings, 0 replies; 5+ messages in thread
From: Tejun Heo @ 2026-03-07 18:17 UTC (permalink / raw)
To: Breno Leitao, jiangshanlai; +Cc: linux-kernel, kernel-team
> Breno Leitao (3):
> tools/workqueue/wq_dump.py: remove backslash separator from node_nr/max_active header
> tools/workqueue/wq_dump.py: fix column alignment in node_nr/max_active section
> tools/workqueue/wq_dump.py: add NODE prefix to all node columns
Applied 1-3 to wq/for-7.1.
Thanks.
--
tejun
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-03-07 18:17 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-03-07 17:47 [PATCH 0/3] workqueue: Fix table in wq_dump.py for large number of workqueues Breno Leitao
2026-03-07 17:47 ` [PATCH 1/3] tools/workqueue/wq_dump.py: remove backslash separator from node_nr/max_active header Breno Leitao
2026-03-07 17:47 ` [PATCH 2/3] tools/workqueue/wq_dump.py: fix column alignment in node_nr/max_active section Breno Leitao
2026-03-07 17:47 ` [PATCH 3/3] tools/workqueue/wq_dump.py: add NODE prefix to all node columns Breno Leitao
2026-03-07 18:17 ` [PATCH 0/3] workqueue: Fix table in wq_dump.py for large number of workqueues Tejun Heo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome