[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <c71995ce6233b88ed838d64ed894624cd7ee2687.1667822611.git.ritesh.list@gmail.com>
Date: Mon, 7 Nov 2022 17:51:46 +0530
From: "Ritesh Harjani (IBM)" <ritesh.list@...il.com>
To: Theodore Ts'o <tytso@....edu>
Cc: linux-ext4@...r.kernel.org,
Harshad Shirwadkar <harshadshirwadkar@...il.com>,
Wang Shilong <wshilong@....com>,
Andreas Dilger <adilger.kernel@...ger.ca>,
Li Xi <lixi@....com>, Ritesh Harjani <ritesh.list@...il.com>
Subject: [RFCv1 58/72] e2fsck: make default smallest RA size to 1M
From: Wang Shilong <wshilong@....com>
If we have a smaller inodes per group, default ra size could
be very small(etc 128KiB), this hurts performances.
Tune above 128K to 1M, i see pass1 time drop down from
677.12 seconds to 246 secons with 32 threads.
Signed-off-by: Wang Shilong <wshilong@....com>
Signed-off-by: Ritesh Harjani (IBM) <ritesh.list@...il.com>
---
e2fsck/readahead.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/e2fsck/readahead.c b/e2fsck/readahead.c
index 38d4ec42..40b73664 100644
--- a/e2fsck/readahead.c
+++ b/e2fsck/readahead.c
@@ -234,6 +234,8 @@ int e2fsck_can_readahead(ext2_filsys fs)
return err != EXT2_ET_OP_NOT_SUPPORTED;
}
+#define MIN_DEFAULT_RA (1024 * 1024)
+
unsigned long long e2fsck_guess_readahead(ext2_filsys fs)
{
unsigned long long guess;
@@ -245,6 +247,8 @@ unsigned long long e2fsck_guess_readahead(ext2_filsys fs)
* in e2fsck runtime.
*/
guess = 2ULL * fs->blocksize * fs->inode_blocks_per_group;
+ if (guess < MIN_DEFAULT_RA)
+ guess = MIN_DEFAULT_RA;
/* Disable RA if it'd use more 1/50th of RAM. */
if (get_memory_size() > (guess * 50))
--
2.37.3
Powered by blists - more mailing lists