workqueue: Introduce show_one_worker_pool and show_one_workqueue.
Subsystems (4)
RFC PATCH v4 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 v4:
- Rebase on git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq.git
for-5.16 drivers/tty/sysrq.c | 2 +- include/linux/workqueue.h | 3 +- kernel/power/process.c | 2 +- kernel/workqueue.c | 172 +++++++++++++++++++++----------------- 4 files changed, 100 insertions(+), 79 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
@@ -469,7 +469,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 +96 -76
213 lines not on this page · raw message
base-commit: d25302e46592c97d29f70ccb1be558df31a9a360
Signature · 1 line
2.30.2
Greg KH
maintainerQuoted 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
Signed-off-by Imran Khan <[email protected]>---
Changes in v4:
- Rebase ongit://git.kernel.org/pub/scm/linux/kernel/git/tj/wq.gitfor-5.16
"RFC" means "I am not sure about this patch, please do not apply it."
Yet a v4 is very odd, why not be sure about this?
thanks,
greg k-h
Hi Greg,
Quoted 1 line · Greg KH
On Wed, Oct 20, 2021 at 02:09:00PM +1100, Imran Khan wrote:
[...]
Quoted 9 lines
Quoted 6 lines
Signed-off-by Imran Khan <[email protected]>---
Changes in v4:
- Rebase ongit://git.kernel.org/pub/scm/linux/kernel/git/tj/wq.gitfor-5.16"RFC" means "I am not sure about this patch, please do not apply it."
Thanks for clarifying this.
Quoted 1 line
Yet a v4 is very odd, why not be sure about this?
I have not got any negative feedback about the change so far, so I am fairly sure about it now. There was a mistake in my understanding where I thought that something that starts as an RFC remains like that in subsequent revisions. I will definitely be mindful about it in future. Could you please let me know if I should send a "PATCH v5", removing RFC from the subject.
Thanks,
Imran
Quoted 5 lines
thanks,
greg k-h
Quoted 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]>
Applied to wq/for-5.16.
Thank you.
Signature · 1 line
tejun