linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: imran.f.khan@oracle.com
To: Tejun Heo <tj@kernel.org>
Cc: jiangshanlai@gmail.com, linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH] workqueue: Introduce __show_worker_pool_state and __show_workqueue_state.
Date: Tue, 5 Oct 2021 20:55:47 +1100	[thread overview]
Message-ID: <447be1eb-87df-6941-1e5c-db79918dc77b@oracle.com> (raw)
In-Reply-To: <YVsvAQ94ucYdGNVM@slm.duckdns.org>



On 5/10/21 3:42 am, Tejun Heo wrote:
> On Tue, Sep 28, 2021 at 08:31:06PM +1000, Imran Khan wrote:
>> Currently show_workqueue_state shows the state of all workqueues and of
>> all worker pools.
>> Divide it into more granular functions (__show_workqueue_state and
>> __show_worker_pool_state), that would show states of individual workqueues
>> and worker pools.
> 
> But why is this change good? Are you building something on top later?
> 

The main motive was to dump data pertaining to only that workqueue which 
is being destroyed in destroy_workqueue.

diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index cfae0c8d5e2e..e191646dd3e4 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -4447,7 +4447,7 @@ void destroy_workqueue(struct workqueue_struct *wq)
                         raw_spin_unlock_irq(&pwq->pool->lock);
                         mutex_unlock(&wq->mutex);
                         mutex_unlock(&wq_pool_mutex);
-                       show_workqueue_state();
+                       __show_workqueue_state(wq);
                         return;
                 }
                 raw_spin_unlock_irq(&pwq->pool->lock);

Please let me know if I am missing some information that may be helpful 
here and can be obtained only by dumping the states of other workqueues.

Then while going through the code, it seemed better to break 
show_workqueue_state into more granular entities which can be used later 
for cases such as one mentioned above.

Thanks for reviewing this.

  -- Imran


> Thanks.
> 

  reply	other threads:[~2021-10-05  9:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-28 10:31 [RFC PATCH] workqueue: Introduce __show_worker_pool_state and __show_workqueue_state Imran Khan
2021-10-04 16:42 ` Tejun Heo
2021-10-05  9:55   ` imran.f.khan [this message]
2021-10-05 16:09     ` Tejun Heo
2021-10-05 21:46       ` imran.f.khan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=447be1eb-87df-6941-1e5c-db79918dc77b@oracle.com \
    --to=imran.f.khan@oracle.com \
    --cc=jiangshanlai@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tj@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).