linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ext4: Reflect mb_optimize_scan value in options file
@ 2022-07-04  5:46 Ojaswin Mujoo
  2022-07-22 13:58 ` Theodore Ts'o
  0 siblings, 1 reply; 2+ messages in thread
From: Ojaswin Mujoo @ 2022-07-04  5:46 UTC (permalink / raw)
  To: linux-ext4; +Cc: Theodore Ts'o, Ritesh Harjani, linux-fsdevel, linux-kernel

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.

Signed-off-by: Ojaswin Mujoo <ojaswin@linux.ibm.com>
---
 fs/ext4/super.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 845f2f8aee5f..e3fd50b0d6b7 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -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;
 }
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ext4: Reflect mb_optimize_scan value in options file
  2022-07-04  5:46 [PATCH] ext4: Reflect mb_optimize_scan value in options file Ojaswin Mujoo
@ 2022-07-22 13:58 ` Theodore Ts'o
  0 siblings, 0 replies; 2+ messages in thread
From: Theodore Ts'o @ 2022-07-22 13:58 UTC (permalink / raw)
  To: ojaswin, linux-ext4
  Cc: Theodore Ts'o, linux-kernel, riteshh, linux-fsdevel

On Mon, 4 Jul 2022 11:16:03 +0530, Ojaswin Mujoo wrote:
> 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,
-- 
Theodore Ts'o <tytso@mit.edu>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-07-22 13:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-04  5:46 [PATCH] ext4: Reflect mb_optimize_scan value in options file Ojaswin Mujoo
2022-07-22 13:58 ` Theodore Ts'o

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).