Commit 2a1b02b
committed
workqueue: Refactor worker ID formatting and make wq_worker_comm() use full ID string
Currently, worker ID formatting is open coded in create_worker(),
init_rescuer() and worker_thread() (for %WORKER_DIE case). The formatted ID
is saved into task->comm and wq_worker_comm() uses it as the base name to
append extra information to when generating the name to be shown to
userspace.
However, TASK_COMM_LEN is only 16 leading to badly truncated names for
rescuers. For example, the rescuer for the inet_frag_wq workqueue becomes:
$ ps -ef | grep '[k]worker/R-inet'
root 483 2 0 Apr26 ? 00:00:00 [kworker/R-inet_]
Even for non-rescue workers, it's easy to run over 15 characters on
moderately large machines.
Fit it by consolidating worker ID formatting into a new helper
format_worker_id() and calling it from wq_worker_comm() to obtain the
untruncated worker ID string.
$ ps -ef | grep '[k]worker/R-inet'
root 60 2 0 12:10 ? 00:00:00 [kworker/R-inet_frag_wq]
Signed-off-by: Tejun Heo <tj@kernel.org>
Reported-and-tested-by: Jan Engelhardt <jengelh@inai.de>
Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>1 parent 8f6a15f commit 2a1b02b
1 file changed
Lines changed: 34 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
| 128 | + | |
128 | 129 | | |
129 | 130 | | |
130 | 131 | | |
| |||
2742 | 2743 | | |
2743 | 2744 | | |
2744 | 2745 | | |
| 2746 | + | |
| 2747 | + | |
| 2748 | + | |
| 2749 | + | |
| 2750 | + | |
| 2751 | + | |
| 2752 | + | |
| 2753 | + | |
| 2754 | + | |
| 2755 | + | |
| 2756 | + | |
| 2757 | + | |
| 2758 | + | |
| 2759 | + | |
| 2760 | + | |
| 2761 | + | |
| 2762 | + | |
| 2763 | + | |
| 2764 | + | |
| 2765 | + | |
2745 | 2766 | | |
2746 | 2767 | | |
2747 | 2768 | | |
| |||
2758 | 2779 | | |
2759 | 2780 | | |
2760 | 2781 | | |
2761 | | - | |
2762 | 2782 | | |
2763 | 2783 | | |
2764 | 2784 | | |
| |||
2777 | 2797 | | |
2778 | 2798 | | |
2779 | 2799 | | |
2780 | | - | |
2781 | | - | |
2782 | | - | |
2783 | | - | |
2784 | | - | |
| 2800 | + | |
2785 | 2801 | | |
| 2802 | + | |
2786 | 2803 | | |
2787 | | - | |
| 2804 | + | |
2788 | 2805 | | |
2789 | 2806 | | |
2790 | | - | |
| 2807 | + | |
2791 | 2808 | | |
2792 | 2809 | | |
2793 | 2810 | | |
| |||
3350 | 3367 | | |
3351 | 3368 | | |
3352 | 3369 | | |
3353 | | - | |
3354 | 3370 | | |
3355 | 3371 | | |
3356 | 3372 | | |
| |||
5542 | 5558 | | |
5543 | 5559 | | |
5544 | 5560 | | |
| 5561 | + | |
5545 | 5562 | | |
5546 | 5563 | | |
5547 | 5564 | | |
| |||
5555 | 5572 | | |
5556 | 5573 | | |
5557 | 5574 | | |
5558 | | - | |
| 5575 | + | |
| 5576 | + | |
| 5577 | + | |
5559 | 5578 | | |
5560 | 5579 | | |
5561 | 5580 | | |
| |||
6384 | 6403 | | |
6385 | 6404 | | |
6386 | 6405 | | |
6387 | | - | |
6388 | | - | |
6389 | | - | |
6390 | | - | |
6391 | | - | |
6392 | | - | |
6393 | | - | |
6394 | 6406 | | |
6395 | 6407 | | |
6396 | 6408 | | |
6397 | 6409 | | |
6398 | 6410 | | |
6399 | 6411 | | |
| 6412 | + | |
| 6413 | + | |
| 6414 | + | |
6400 | 6415 | | |
6401 | 6416 | | |
6402 | 6417 | | |
| |||
6415 | 6430 | | |
6416 | 6431 | | |
6417 | 6432 | | |
| 6433 | + | |
| 6434 | + | |
6418 | 6435 | | |
6419 | 6436 | | |
6420 | 6437 | | |
| |||
0 commit comments