From: Baokun Li <libaokun@linux.alibaba.com>
To: Theodore Tso <tytso@mit.edu>, Baolin Liu <liubaolin12138@163.com>
Cc: adilger.kernel@dilger.ca, ojaswin@linux.ibm.com,
ritesh.list@gmail.com, yi.zhang@huawei.com,
linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org,
wangguanyu@vivo.com, Baolin Liu <liubaolin@kylinos.cn>,
Andreas Dilger <adilger@dilger.ca>
Subject: Re: [PATCH v3 v3 2/2] ext4: allow clearing mballoc stats through mb_stats
Date: Fri, 24 Apr 2026 11:12:04 +0800 [thread overview]
Message-ID: <38a32a36-705f-4996-a49b-621dfdc5bb26@linux.alibaba.com> (raw)
In-Reply-To: <20260423161947.GB68318@macsyma-wired.lan>
On 2026/4/24 00:19, Theodore Tso wrote:
> On Wed, Apr 22, 2026 at 09:50:25AM +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.
> At the moment to enable mb_stats the system administrator needs to
> write "1" to /sys/fs/ext4/<dev>/mb_stats, and writing "0" to the sysfs
> file will pauce the statistics colleciton (but not clear the
> statistics). Adding a way to clear the statistics by writing to the
> procfs file might be confusing to users.
>
> So.... as a suggestion, if you're adding to the ability to write to
> /proc/fs/.../mb_stats, what if we make things work by
>
> * Write 1 to /proc/fs/.../mb_stats to enable statistics collection
> * Write 0 to /proc/fs/.../mb_stats to disable statistics collection
> * Write -1 to /proc/fs/.../mb_stats to clear statistics counters
>
> And then deprecate the /sys/fs/.../mb_stats variable (but we probably
> won't be able to remove it for at least a year or two).
I like this idea. Consolidating everything into /proc/fs/.../mb_stats
and using -1 to reset the counters is much cleaner than the current
split approach.
Cheers,
Baokun
next prev parent reply other threads:[~2026-04-24 3:12 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-22 1:50 [PATCH v3 v3 0/2] add blocks_allocated to mb_stats and clear mb_stats Baolin Liu
2026-04-22 1:50 ` [PATCH v3 v3 1/2] ext4: add blocks_allocated to mb_stats output Baolin Liu
2026-04-24 2:35 ` Baokun Li
2026-04-22 1:50 ` [PATCH v3 v3 2/2] ext4: allow clearing mballoc stats through mb_stats Baolin Liu
2026-04-23 16:19 ` Theodore Tso
2026-04-24 3:12 ` Baokun Li [this message]
2026-04-24 8:09 ` liubaolin
2026-04-24 9:34 ` Baokun Li
2026-04-27 1:29 ` liubaolin
2026-04-24 12:07 ` Theodore Tso
2026-04-27 1:24 ` liubaolin
2026-04-22 9:55 ` [PATCH v3 v3 0/2] add blocks_allocated to mb_stats and clear mb_stats liubaolin
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=38a32a36-705f-4996-a49b-621dfdc5bb26@linux.alibaba.com \
--to=libaokun@linux.alibaba.com \
--cc=adilger.kernel@dilger.ca \
--cc=adilger@dilger.ca \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=liubaolin12138@163.com \
--cc=liubaolin@kylinos.cn \
--cc=ojaswin@linux.ibm.com \
--cc=ritesh.list@gmail.com \
--cc=tytso@mit.edu \
--cc=wangguanyu@vivo.com \
--cc=yi.zhang@huawei.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