From: zhaoyuenan <amktiao030215@gmail.com>
To: chao@kernel.org
Cc: jaegeuk@kernel.org, linux-kernel@vger.kernel.org,
linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [PATCH] f2fs: Add ckpt_thread_task sysfs node
Date: Fri, 22 May 2026 21:56:54 +0800 [thread overview]
Message-ID: <20260522135654.19535-1-amktiao030215@gmail.com> (raw)
In-Reply-To: <20260521151008.13682-1-amktiao030215@gmail.com>
Hi Chao,
On 5/22/26 10:50, Chao Yu wrote:
> Hi Yuenan,
>
> Thanks for your contribution!
>
> If there is a method to get pid via userspace, I prefer to do it in userspace,
> rather than implementing and maintaining an duplicated one in kernel.
>
> Or do you have a strong reason to do this in kernel?
The main reason is that retrieving this PID from userspace is currently
quite complex and fragile.
Previously, userspace tools had to rely on pipelines like:
pgrep f2fs_ckpt-$(ls -l /dev/block/by-name/userdata | awk '{print $5$6}' | tr ',' ':')
This approach has a few drawbacks:
1. It requires parsing major/minor numbers and executing multiple commands,
which is inefficient for simple monitoring tools.
2. On some older kernels, the thread name can be truncated due to TASK_COMM_LEN
limitations, causing 'pgrep' to fail to match the full 'f2fs_ckpt-X:Y' string.
Exposing the PID via a sysfs node provides a deterministic, lightweight,
and reliable way (just a simple 'cat') to fetch it without any userspace
guessing or complex parsing.
Does this address your concern?
Thanks,
Yuenan
next parent reply other threads:[~2026-05-22 13:57 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20260521151008.13682-1-amktiao030215@gmail.com>
2026-05-22 13:56 ` zhaoyuenan [this message]
2026-06-10 12:09 ` Chao Yu
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=20260522135654.19535-1-amktiao030215@gmail.com \
--to=amktiao030215@gmail.com \
--cc=chao@kernel.org \
--cc=jaegeuk@kernel.org \
--cc=linux-f2fs-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.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
all inboxes | Powered by JetHome®