Skip to contentSkip to conversation

ext4: Reflect mb_optimize_scan value in options file

PATCH Applied Ojaswin Mujoo 2 participants 2 messages Jul 4, 2022 – Jul 22, 2022

Subsystems (2)
lore
Share & tools
lore

Ojaswin Mujoo

author reviewer
#0 lore raw

PATCH 1/1 ext4: Reflect mb_optimize_scan value in options file

Add support to display the mb_optimize_scan value in /proc/fs/ext4/<dev>/options file. The option is only displayed when the value is non default.

---
 fs/ext4/super.c | 9 +++++++++
 1 file changed, 9 insertions(+)
fs/ext4/super.c +9 -0
index 845f2f8aee5f..e3fd50b0d6b7 100644
@@ -3011,6 +3011,15 @@ 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 (sbi->s_groups_count >= MB_DEFAULT_LINEAR_SCAN_THRESHOLD &&
+			!test_opt2(sb, MB_OPTIMIZE_SCAN)) {
+		SEQ_OPTS_PUTS("mb_optimize_scan=0");
+	} else if (sbi->s_groups_count < MB_DEFAULT_LINEAR_SCAN_THRESHOLD &&
+			test_opt2(sb, MB_OPTIMIZE_SCAN)) {
+		SEQ_OPTS_PUTS("mb_optimize_scan=1");
+	}
+
 	ext4_show_quota_options(seq, sb);
 	return 0;
 }
Signature · 1 line
2.27.0
maintainer Applied
#1 lore raw
Quoted 5 lines · Ojaswin Mujoo

Add support to display the mb_optimize_scan value in /proc/fs/ext4/<dev>/options file. The option is only displayed when the value is non default.

Applied, thanks!

[1/1] ext4: Reflect mb_optimize_scan value in options file

      commit: 961edf078b5606ce480ae2ebdac64ca829ea3f75

Best regards,

Signature · 1 line
Theodore Ts'o <[email protected]>