public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
From: Artem Blagodarenko <artem.blagodarenko@gmail.com>
To: linux-ext4@vger.kernel.org
Cc: alexey.lyashkov@gmail.com,
	Andrew Perepechko <andrew.perepechko@seagate.com>
Subject: [PATCH] ext4: preload block group descriptors
Date: Mon, 20 Feb 2017 19:45:53 +0300	[thread overview]
Message-ID: <1487609153-3367-1-git-send-email-artem.blagodarenko@gmail.com> (raw)

From: Andrew Perepechko <andrew.perepechko@seagate.com>

With enabled meta_bg option block group descriptors
reading IO is not sequential and requires optimization.

Signed-off-by: Andrew Perepechko <andrew.perepechko@seagate.com>
---
 fs/ext4/super.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index a673558..0e52c91 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -3879,6 +3879,12 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
 
 	bgl_lock_init(sbi->s_blockgroup_lock);
 
+	/* Pre-read the descriptors into the buffer cache */
+	for (i = 0; i < db_count; i++) {
+		block = descriptor_loc(sb, logical_sb_block, i);
+		sb_breadahead(sb, block);
+	}
+
 	for (i = 0; i < db_count; i++) {
 		block = descriptor_loc(sb, logical_sb_block, i);
 		sbi->s_group_desc[i] = sb_bread_unmovable(sb, block);
-- 
1.8.3.1

             reply	other threads:[~2017-02-20 16:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-20 16:45 Artem Blagodarenko [this message]
2017-02-28 16:19 ` [PATCH] ext4: preload block group descriptors Darrick J. Wong
2017-02-28 16:29   ` Alexey Lyashkov
2017-04-30  4:54 ` Theodore Ts'o

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1487609153-3367-1-git-send-email-artem.blagodarenko@gmail.com \
    --to=artem.blagodarenko@gmail.com \
    --cc=alexey.lyashkov@gmail.com \
    --cc=andrew.perepechko@seagate.com \
    --cc=linux-ext4@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox