Re: [PATCH v2 v2 2/2] ext4: allow clearing mballoc stats through mb_stats

Andreas Dilger
2026-04-20T18:28:54Z

On Apr 20, 2026, at 03:12, Ojaswin Mujoo <ojaswin@linux.ibm.com> wrote:
>
> On Sun, Apr 19, 2026 at 02:34:36PM +0800, Baolin Liu wrote:
>> From: Baolin Liu <liubaolin@kylinos.cn>
>>
>> Make /proc/fs/ext4/<dev>/mb_stats writable and clear the runtime
>> mballoc statistics when 0 is written.
>>
>> Signed-off-by: Baolin Liu <liubaolin@kylinos.cn>
>> ---
> 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

That could be documented in Documentation/filesystems/ext4/allocators.rst,
or better would be to add a new file that covers mballoc in more detail.

Cheers, Andreas