diff options
author | Theodore Ts'o <tytso@mit.edu> | 2022-12-14 19:41:32 -0500 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2022-12-14 19:41:32 -0500 |
commit | cf6b572dd5f0a0c0577a2d0b859ba94edb3b6a1c (patch) | |
tree | 2501cc014c4175650f0f6ed9b1556f76a3041cb6 | |
parent | 1da18e38cb97e9521e93d63034521a9649524f64 (diff) | |
download | ext4-tt/newwrite.tar.gz |
ext4: wire up the "new_write" optiontt/newwrite
For debugging purposes, the new_write mount option will enable the
ext4 write codepath. This will allow us to compare the old and new
write paths from a stability and benchmarking perspective.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
-rw-r--r-- | fs/ext4/ext4.h | 3 | ||||
-rw-r--r-- | fs/ext4/super.c | 5 |
2 files changed, 8 insertions, 0 deletions
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h index 140e1eb300d177..408980a76835de 100644 --- a/fs/ext4/ext4.h +++ b/fs/ext4/ext4.h @@ -1267,6 +1267,9 @@ struct ext4_inode_info { #define EXT4_MOUNT2_MB_OPTIMIZE_SCAN 0x00000080 /* Optimize group * scanning in mballoc */ +#define EXT4_MOUNT2_NEW_WRITE 0x00000100 /* New write path to replace + dioread_nolock and + nodioread_nolock */ #define clear_opt(sb, opt) EXT4_SB(sb)->s_mount_opt &= \ ~EXT4_MOUNT_##opt diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 72ead3b567061d..1227e0c6c00929 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -1591,6 +1591,7 @@ enum { Opt_max_dir_size_kb, Opt_nojournal_checksum, Opt_nombcache, Opt_no_prefetch_block_bitmaps, Opt_mb_optimize_scan, Opt_errors, Opt_data, Opt_data_err, Opt_jqfmt, Opt_dax_type, + Opt_new_write, #ifdef CONFIG_EXT4_DEBUG Opt_fc_debug_max_replay, Opt_fc_debug_force #endif @@ -1731,6 +1732,7 @@ static const struct fs_parameter_spec ext4_param_specs[] = { Opt_removed), fsparam_flag ("no_prefetch_block_bitmaps", Opt_no_prefetch_block_bitmaps), + fsparam_flag ("new_write", Opt_new_write), fsparam_s32 ("mb_optimize_scan", Opt_mb_optimize_scan), fsparam_string ("check", Opt_removed), /* mount option from ext2/3 */ fsparam_flag ("nocheck", Opt_removed), /* mount option from ext2/3 */ @@ -1830,6 +1832,7 @@ static const struct mount_opts { {Opt_fc_debug_force, EXT4_MOUNT2_JOURNAL_FAST_COMMIT, MOPT_SET | MOPT_2 | MOPT_EXT4_ONLY}, #endif + {Opt_new_write, EXT4_MOUNT2_NEW_WRITE, MOPT_SET | MOPT_2 }, {Opt_err, 0, 0} }; @@ -2978,6 +2981,8 @@ static int _ext4_show_options(struct seq_file *seq, struct super_block *sb, } else if (test_opt2(sb, DAX_INODE)) { SEQ_OPTS_PUTS("dax=inode"); } + if (test_opt2(sb, NEW_WRITE)) + SEQ_OPTS_PUTS("new_write"); if (sbi->s_groups_count >= MB_DEFAULT_LINEAR_SCAN_THRESHOLD && !test_opt2(sb, MB_OPTIMIZE_SCAN)) { |