linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Harshad Shirwadkar <harshadshirwadkar@gmail.com>
To: linux-ext4@vger.kernel.org
Cc: tytso@mit.edu, lyx1209@gmail.com,
	Harshad Shirwadkar <harshadshirwadkar@gmail.com>
Subject: [PATCH 4/9] ext4: add prefetching support for freespace trees
Date: Wed, 19 Aug 2020 00:30:59 -0700	[thread overview]
Message-ID: <20200819073104.1141705-5-harshadshirwadkar@gmail.com> (raw)
In-Reply-To: <20200819073104.1141705-1-harshadshirwadkar@gmail.com>

This patch supports creation of freespace trees for prefetched block
bitmaps.

Signed-off-by: Harshad Shirwadkar <harshadshirwadkar@gmail.com>
---
 fs/ext4/mballoc.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
index 74bdc2dcb49c..1f4e69c6f488 100644
--- a/fs/ext4/mballoc.c
+++ b/fs/ext4/mballoc.c
@@ -3145,6 +3145,9 @@ ext4_group_t ext4_mb_prefetch(struct super_block *sb, ext4_group_t group,
 void ext4_mb_prefetch_fini(struct super_block *sb, ext4_group_t group,
 			   unsigned int nr)
 {
+	struct ext4_buddy e4b;
+	int ret;
+
 	while (nr-- > 0) {
 		struct ext4_group_desc *gdp = ext4_get_group_desc(sb, group,
 								  NULL);
@@ -3159,8 +3162,15 @@ void ext4_mb_prefetch_fini(struct super_block *sb, ext4_group_t group,
 		    ext4_free_group_clusters(sb, gdp) > 0 &&
 		    !(ext4_has_group_desc_csum(sb) &&
 		      (gdp->bg_flags & cpu_to_le16(EXT4_BG_BLOCK_UNINIT)))) {
-			if (ext4_mb_init_group(sb, group, GFP_NOFS))
+			if (ext4_mb_frsp_on(sb)) {
+				ret = ext4_mb_load_allocator(sb, group, &e4b,
+							     0);
+				if (ret)
+					break;
+				ext4_mb_unload_allocator(&e4b);
+			} else if (ext4_mb_init_group(sb, group, GFP_NOFS)) {
 				break;
+			}
 		}
 	}
 }
-- 
2.28.0.220.ged08abb693-goog


  parent reply	other threads:[~2020-08-19  7:31 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-19  7:30 [PATCH 0/9] ext4: add free-space extent based allocator Harshad Shirwadkar
2020-08-19  7:30 ` [PATCH 1/9] ext4: add handling for extended mount options Harshad Shirwadkar
2020-08-19  7:30 ` [PATCH 2/9] ext4: rename ext4_mb_load_buddy to ext4_mb_load_allocator Harshad Shirwadkar
2020-08-19  7:30 ` [PATCH 3/9] ext4: add freespace tree allocator Harshad Shirwadkar
2020-09-03 13:45   ` Благодаренко Артём
2020-08-19  7:30 ` Harshad Shirwadkar [this message]
2020-08-19  7:31 ` [PATCH 5/9] ext4: add freespace tree optimizations Harshad Shirwadkar
2020-08-19  7:31 ` [PATCH 6/9] ext4: add memory usage tracker for freespace trees Harshad Shirwadkar
2020-08-28 13:57   ` Благодаренко Артём
2020-08-28 15:22     ` harshad shirwadkar
2020-08-19  7:31 ` [PATCH 7/9] ext4: add LRU eviction for free space trees Harshad Shirwadkar
2020-08-19  7:31 ` [PATCH 8/9] ext4: add tracepoints " Harshad Shirwadkar
2020-08-19  7:31 ` [PATCH 9/9] ext4: add freespace trees documentation in code Harshad Shirwadkar

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=20200819073104.1141705-5-harshadshirwadkar@gmail.com \
    --to=harshadshirwadkar@gmail.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=lyx1209@gmail.com \
    --cc=tytso@mit.edu \
    /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;
as well as URLs for NNTP newsgroup(s).