* Re: [PATCH] f2fs: Add ckpt_thread_task sysfs node
[not found] <20260521151008.13682-1-amktiao030215@gmail.com>
@ 2026-05-22 13:56 ` zhaoyuenan
2026-06-10 12:09 ` Chao Yu
0 siblings, 1 reply; 2+ messages in thread
From: zhaoyuenan @ 2026-05-22 13:56 UTC (permalink / raw)
To: chao; +Cc: jaegeuk, linux-kernel, linux-f2fs-devel
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] f2fs: Add ckpt_thread_task sysfs node
2026-05-22 13:56 ` [PATCH] f2fs: Add ckpt_thread_task sysfs node zhaoyuenan
@ 2026-06-10 12:09 ` Chao Yu
0 siblings, 0 replies; 2+ messages in thread
From: Chao Yu @ 2026-06-10 12:09 UTC (permalink / raw)
To: zhaoyuenan; +Cc: chao, jaegeuk, linux-kernel, linux-f2fs-devel
Hi Yuenan,
On 5/22/26 21:56, zhaoyuenan wrote:
> 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.
I don't see why there is any performance concern in your scenario.
> 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.
I don't think this method has scalability, is it better to backport below patch? so
that you can trace all kthreads and set them to target cgroup.
https://lore.kernel.org/all/20211120112850.46047-1-laoar.shao@gmail.com
Thanks,
>
> 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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-06-10 12:09 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20260521151008.13682-1-amktiao030215@gmail.com>
2026-05-22 13:56 ` [PATCH] f2fs: Add ckpt_thread_task sysfs node zhaoyuenan
2026-06-10 12:09 ` Chao Yu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox