Re: [PATCH v2 v2 2/2] ext4: allow clearing mballoc stats through mb_stats
From: Ojaswin Mujoo
Date: Mon Apr 20 2026 - 05:13:15 EST
On Sun, Apr 19, 2026 at 02:34:36PM +0800, Baolin Liu wrote:
> From: Baolin Liu <liubaolin@xxxxxxxxxx>
>
> Make /proc/fs/ext4/<dev>/mb_stats writable and clear the runtime
> mballoc statistics when 0 is written.
>
> Signed-off-by: Baolin Liu <liubaolin@xxxxxxxxxx>
> ---
Hi Baolin, thanks for the changes.
Seems like userspace doesn't have any way to know that writing 0 will
clear the that. Well, I guess if you are looking at this file you are
anyways debugging kernel code so that should be fine
Feel free to add:
Ojaswin Mujoo <ojaswin@xxxxxxxxxxxxx>
Regards,
ojaswin
> fs/ext4/ext4.h | 1 +
> fs/ext4/mballoc.c | 29 +++++++++++++++++++++++++++++
> fs/ext4/sysfs.c | 40 ++++++++++++++++++++++++++++++++++++++--
> 3 files changed, 68 insertions(+), 2 deletions(-)
>