From: Tejun Heo <tj@kernel.org>
To: Wilson Felipe Pereira <wfelipe@google.com>
Cc: Lai Jiangshan <jiangshanlai@gmail.com>,
Jonathan Corbet <corbet@lwn.net>,
Shuah Khan <skhan@linuxfoundation.org>,
Randy Dunlap <rdunlap@infradead.org>,
linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
Shuhao Tan <tanshuhao@google.com>
Subject: Re: [PATCH 2/3] workqueue: expose per-workqueue stats in debugfs
Date: Fri, 23 Oct 2026 06:45:47 -1000 [thread overview]
Message-ID: <dcb56290d3d9342958397ee75f915528@kernel.org> (raw)
In-Reply-To: <p973h5idt9qm.fsf@wfelipe-west1.c.googlers.com>
Hello, Wilson.
On Fri, Oct 23, 2026 at 02:46:09AM +0000, Wilson Felipe Pereira wrote:
> That's fair, I thought it could be useful to have a file interface
> exposing these stats, but BPF/BTF is simple enough as well.
If you want a file-like interface, look at BPF iterators. I'm not
necessarily against adding an iter/workqueue target but it isn't really
necessary either. A userspace program can talk to the BPF side and
expose the data to the collector however it wants, e.g. a named FIFO, a
tmpfs file, whatever.
> If you still think the other two patches make sense to you, I can send a
> v2 without patch 2.
The extra stats the patches add can easily be gathered with BPF hooks.
The in-kernel stats are there because we don't want to add hooks for hot
path events. For cold path events, it's easy to add monitoring to
whatever you want. An fentry hook on pwq_release_workfn(), for example,
sees a released pwq's final counters, which is what the retired stats in
patch 1 collect.
Thanks.
--
tejun
next prev parent reply other threads:[~2026-10-23 16:45 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-22 15:53 [PATCH 0/3] " Wilson Felipe Pereira
2026-10-22 15:53 ` [PATCH 1/3] workqueue: preserve pwq->stats[] when unbound pwqs are released Wilson Felipe Pereira
2026-10-22 15:53 ` [PATCH 2/3] workqueue: expose per-workqueue stats in debugfs Wilson Felipe Pereira
2026-10-22 20:35 ` Tejun Heo
2026-10-22 22:46 ` Wilson Felipe Pereira
2026-10-23 0:19 ` Tejun Heo
2026-10-23 2:46 ` Wilson Felipe Pereira
2026-10-23 16:45 ` Tejun Heo [this message]
2026-10-22 15:53 ` [PATCH 3/3] tools/workqueue: report queued items and retired stats in wq_monitor.py Wilson Felipe Pereira
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=dcb56290d3d9342958397ee75f915528@kernel.org \
--to=tj@kernel.org \
--cc=corbet@lwn.net \
--cc=jiangshanlai@gmail.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rdunlap@infradead.org \
--cc=skhan@linuxfoundation.org \
--cc=tanshuhao@google.com \
--cc=wfelipe@google.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®