ext4: Make sb update interval tunable
authorOjaswin Mujoo <ojaswin@linux.ibm.com>
Tue, 18 Mar 2025 07:52:57 +0000 (13:22 +0530)
committerTheodore Ts'o <tytso@mit.edu>
Fri, 21 Mar 2025 05:12:33 +0000 (01:12 -0400)
commit896b02d0b9e7deb4a4eb365e13dd912b49916519
treeeac5a0e9eed99f4fe0500ef0e9c9d151912f39e1
parentce2f26e73783b4a7c46a86e3af5b5c8de0971790
ext4: Make sb update interval tunable

Currently, outside error paths, we auto commit the super block after 1
hour has passed and 16MB worth of updates have been written since last
commit. This is a policy decision so make this tunable while keeping the
defaults same. This is useful if user wants to tweak the superblock
behavior or for debugging the codepath by allowing to trigger it more
frequently.

We can now tweak the super block update using sb_update_sec and
sb_update_kb files in /sys/fs/ext4/<dev>/

Reviewed-by: Jan Kara <jack@suse.cz>
Reviewed-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
Reviewed-by: Baokun Li <libaokun1@huawei.com>
Signed-off-by: Ojaswin Mujoo <ojaswin@linux.ibm.com>
Link: https://patch.msgid.link/950fb8c9b2905620e16f02a3b9eeea5a5b6cb87e.1742279837.git.ojaswin@linux.ibm.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/ext4/ext4.h
fs/ext4/super.c
fs/ext4/sysfs.c