|
|
Log in / Subscribe / Register

ext4: improve mballoc statistics reporting and control

From:  Baolin Liu <liubaolin12138-AT-163.com>
To:  tytso-AT-mit.edu, adilger.kernel-AT-dilger.ca, libaokun-AT-linux.alibaba.com, jack-AT-suse.cz, ojaswin-AT-linux.ibm.com, ritesh.list-AT-gmail.com, yi.zhang-AT-huawei.com, corbet-AT-lwn.net, skhan-AT-linuxfoundation.org
Subject:  [PATCH v5 v5 0/3] ext4: improve mballoc statistics reporting and control
Date:  Fri, 22 May 2026 11:59:02 +0800
Message-ID:  <20260522035905.1145743-1-liubaolin12138@163.com>
Cc:  linux-ext4-AT-vger.kernel.org, linux-kernel-AT-vger.kernel.org, Baolin Liu <liubaolin12138-AT-163.com>
Archive-link:  Article

This series improves mballoc statistics reporting and control by adding
blocks_allocated to /proc/fs/ext4/<dev>/mb_stats, using
READ_ONCE()/WRITE_ONCE() for concurrent accesses to s_mb_stats, and 
allowing mballoc stats to be controlled through
/proc/fs/ext4/<dev>/mb_stats.

Changes in v5: 
 - Use READ_ONCE()/WRITE_ONCE() for s_mb_stats accesses instead of
   converting s_mb_stats to atomic_t, as suggested in review.
 - For proc mb_stats writes of -1, disable stats collection before
   clearing the counters, then re-enable it.

Baolin Liu (3):
  ext4: add blocks_allocated to mb_stats output
  ext4: use READ_ONCE/WRITE_ONCE for s_mb_stats
  ext4: allow controlling mballoc stats through proc mb_stats

 Documentation/ABI/testing/sysfs-fs-ext4 |  3 +-
 Documentation/admin-guide/ext4.rst      |  9 ++-
 Documentation/filesystems/proc.rst      | 13 +----
 fs/ext4/ext4.h                          |  1 +
 fs/ext4/mballoc.c                       | 57 ++++++++++++++-----
 fs/ext4/sysfs.c                         | 73 ++++++++++++++++++++++++-
 6 files changed, 126 insertions(+), 30 deletions(-)

-- 
2.51.0




Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds