workqueue: Introduce show_one_worker_pool and show_one_workqueue.
Subsystems (4)
RFC PATCH v3 1/1 workqueue: Introduce show_one_worker_pool and show_one_workqueue.
Currently show_workqueue_state shows the state of all workqueues and of all worker pools. In certain cases we may need to dump state of only a specific workqueue or worker pool. For example in destroy_workqueue we only need to show state of the workqueue which is getting destroyed.
So rename show_workqueue_state to show_all_workqueues(to signify it dumps state of all busy workqueues) and divide it into more granular functions (show_one_workqueue and show_one_worker_pool), that would show states of individual workqueues and worker pools and can be used in cases such as the one mentioned above.
Also, as mentioned earlier, make destroy_workqueue dump data pertaining to only the workqueue that is being destroyed and make user(s) of earlier interface(show_workqueue_state), use new interface (show_all_workqueues).
---
Changes in v3:
- Address review comments regarding function names
- Change users of show_workqueue_state to use show_all_workqueues
drivers/tty/sysrq.c | 2 +- include/linux/workqueue.h | 3 +- kernel/power/process.c | 2 +- kernel/workqueue.c | 148 +++++++++++++++++++++----------------- 4 files changed, 88 insertions(+), 67 deletions(-)
drivers/tty/sysrq.c +1 -1
@@ -296,7 +296,7 @@ static const struct sysrq_key_op sysrq_showregs_op = {static void sysrq_handle_showstate (int key) {show_state (); -show_workqueue_state (); +show_all_workqueues (); }static const struct sysrq_key_op sysrq_showstate_op = { .handler = sysrq_handle_showstate,
include/linux/workqueue.h +2 -1
@@ -470,7 +470,8 @@ extern bool workqueue_congested(int cpu, struct workqueue_struct *wq);extern unsigned int work_busy (struct work_struct *work); extern __printf(1, 2) void set_worker_desc(const char *fmt, ...); extern void print_worker_info(const char *log_lvl, struct task_struct *task); -extern void show_workqueue_state(void); +extern void show_all_workqueues(void); +extern void show_one_workqueue(struct workqueue_struct *wq); extern void wq_worker_comm(char *buf, size_t size, struct task_struct *task); /**
kernel/power/process.c +1 -1
@@ -94,7 +94,7 @@ static int try_to_freeze_tasks(bool user_only) todo - wq_busy, wq_busy);if (wq_busy) -show_workqueue_state (); +show_all_workqueues ();if (!wakeup || pm_debug_messages_on) {read_lock (&tasklist_lock);
kernel/workqueue.c +84 -64
187 lines not on this page · raw message
base-commit: 683f29b781aeaab6bf302eeb2ef08a5e5f9d8a27
Signature · 1 line
2.30.2
Tejun Heo
maintainerQuoted 11 lines · Imran Khan
Currently
show_workqueue_stateshows the state of all workqueues and of all worker pools. In certain cases we may need to dump state of only a specific workqueue or worker pool. For example indestroy_workqueuewe only need to show state of the workqueue which is getting destroyed.So rename
show_workqueue_statetoshow_all_workqueues(to signify it dumps state of all busy workqueues)and divide it into more granular functions (show_one_workqueueandshow_one_worker_pool), that would show states of individual workqueues and worker pools and can be used in cases such as the one mentioned above.
Quoted 6 lines
Also, as mentioned earlier, make
destroy_workqueuedump data pertaining to only the workqueue that is being destroyed and make user(s) of earlierinterface(show_workqueue_state), use new interface (show_all_workqueues).Signed-off-by Imran Khan <[email protected]>
Can you respin the patch on top of the following branch?
git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq.git for-5.16
Thank you.
Signature · 1 line
tejun
Hi Tejun,
Quoted 17 lines · Tejun Heo
Quoted 16 lines · Imran Khan
Currently
show_workqueue_stateshows the state of all workqueues and of all worker pools. In certain cases we may need to dump state of only a specific workqueue or worker pool. For example indestroy_workqueuewe only need to show state of the workqueue which is getting destroyed.So rename
show_workqueue_statetoshow_all_workqueues(to signify it dumps state of all busy workqueues)and divide it into more granular functions (show_one_workqueueandshow_one_worker_pool), that would show states of individual workqueues and worker pools and can be used in cases such as the one mentioned above.Also, as mentioned earlier, make
destroy_workqueuedump data pertaining to only the workqueue that is being destroyed and make user(s) of earlierinterface(show_workqueue_state), use new interface (show_all_workqueues).
Quoted 5 lines
Quoted 1 line
Signed-off-by Imran Khan <[email protected]>Can you respin the patch on top of the following branch?
git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq.gitfor-5.16
Sure, I have rebased it upon the suggested branch and have sent v4 [1] of the change.
[1] https://lore.kernel.org/lkml/[email protected]/
Thanks,
--Imran
Quoted 3 lines
Thank you.