mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: "Paul E. McKenney" <paulmck@kernel.org>
Cc: Lai Jiangshan <jiangshanlai@gmail.com>,
	Dave Jones <davej@codemonkey.org.uk>,
	Rik van Riel <riel@surriel.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH RFC] workqueue: Make show_pwq() use run-length encoding
Date: Fri, 6 Jan 2023 14:24:29 -1000	[thread overview]
Message-ID: <Y7i7vadFAo0z8NoH@slm.duckdns.org> (raw)
In-Reply-To: <20230107001024.GA3893528@paulmck-ThinkPad-P17-Gen-1>

On Fri, Jan 06, 2023 at 04:10:24PM -0800, Paul E. McKenney wrote:
> The show_pwq() function dumps out a pool_workqueue structure's activity,
> including the pending work-queue handlers:
> 
>  Showing busy workqueues and worker pools:
>  workqueue events: flags=0x0
>    pwq 0: cpus=0 node=0 flags=0x1 nice=0 active=10/256 refcnt=11
>      in-flight: 7:test_work_func, 64:test_work_func, 249:test_work_func
>      pending: test_work_func, test_work_func, test_work_func1, test_work_func1, test_work_func1, test_work_func1, test_work_func1
> 
> When large systems are facing certain types of hang conditions, it is not
> unusual for this "pending" list to contain runs of hundreds of identical
> function names.  This "wall of text" is difficult to read, and worse yet,
> it can be interleaved with other output such as stack traces.
> 
> Therefore, make show_pwq() use run-length encoding so that the above
> printout instead looks like this:
> 
>  Showing busy workqueues and worker pools:
>  workqueue events: flags=0x0
>    pwq 0: cpus=0 node=0 flags=0x1 nice=0 active=10/256 refcnt=11
>      in-flight: 7:test_work_func, 64:test_work_func, 249:test_work_func
>      pending: 2*test_work_func, 5*test_work_func1
> 
> When no comma would be printed, including the WORK_STRUCT_LINKED case,
> a new run is started unconditionally.
> 
> This output is more readable, places less stress on the hardware,
> firmware, and software on the console-log path, and reduces interference
> with other output.

This is fantastic. Applied to wq/for-6.3.

Thanks.

-- 
tejun

      reply	other threads:[~2023-01-07  0:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-07  0:10 Paul E. McKenney
2023-01-07  0:24 ` Tejun Heo [this message]

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=Y7i7vadFAo0z8NoH@slm.duckdns.org \
    --to=tj@kernel.org \
    --cc=davej@codemonkey.org.uk \
    --cc=jiangshanlai@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paulmck@kernel.org \
    --cc=riel@surriel.com \
    /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

all inboxes | Powered by JetHome®