diff options
| author | Ojaswin Mujoo <ojaswin@linux.ibm.com> | 2025-03-18 13:22:57 +0530 |
|---|---|---|
| committer | Theodore Ts'o <tytso@mit.edu> | 2025-03-21 01:12:33 -0400 |
| commit | 896b02d0b9e7deb4a4eb365e13dd912b49916519 (patch) | |
| tree | eac5a0e9eed99f4fe0500ef0e9c9d151912f39e1 /fs/ext4/ext4.h | |
| parent | ce2f26e73783b4a7c46a86e3af5b5c8de0971790 (diff) | |
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>
Diffstat (limited to 'fs/ext4/ext4.h')
| -rw-r--r-- | fs/ext4/ext4.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h index 797b5b3d69ba..5a20e9cd7184 100644 --- a/fs/ext4/ext4.h +++ b/fs/ext4/ext4.h @@ -1609,6 +1609,8 @@ struct ext4_sb_info { unsigned int s_mb_prefetch; unsigned int s_mb_prefetch_limit; unsigned int s_mb_best_avail_max_trim_order; + unsigned int s_sb_update_sec; + unsigned int s_sb_update_kb; /* stats for buddy allocator */ atomic_t s_bal_reqs; /* number of reqs with len > 1 */ @@ -2299,6 +2301,13 @@ static inline int ext4_emergency_state(struct super_block *sb) #define EXT4_DEF_MAX_BATCH_TIME 15000 /* 15ms */ /* + * Default values for superblock update + */ +#define EXT4_DEF_SB_UPDATE_INTERVAL_SEC (3600) /* seconds (1 hour) */ +#define EXT4_DEF_SB_UPDATE_INTERVAL_KB (16384) /* kilobytes (16MB) */ + + +/* * Minimum number of groups in a flexgroup before we separate out * directories into the first block group of a flexgroup */ |