lkml.org 
[lkml]   [2023]   [Jan]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH RFC] workqueue: Make show_pwq() use run-length encoding
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

\
 
 \ /
  Last update: 2023-03-26 23:31    [W:0.090 / U:0.124 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site