All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Ted Tso <tytso@mit.edu>
Cc: <linux-ext4@vger.kernel.org>,
	Thorsten Leemhuis <regressions@leemhuis.info>,
	Ojaswin Mujoo <ojaswin@linux.ibm.com>,
	Stefan Wahren <stefan.wahren@i2se.com>,
	Harshad Shirwadkar <harshadshirwadkar@gmail.com>,
	Jan Kara <jack@suse.cz>
Subject: [PATCH 3/5] ext4: Make directory inode spreading reflect flexbg size
Date: Thu,  8 Sep 2022 11:21:26 +0200	[thread overview]
Message-ID: <20220908092136.11770-3-jack@suse.cz> (raw)
In-Reply-To: <20220908091301.147-1-jack@suse.cz>

Currently the Orlov inode allocator searches for free inodes for a
directory only in flex block groups with at most inodes_per_group/16
more directory inodes than average per flex block group. However with
growing size of flex block group this becomes unnecessarily strict.
Scale allowed difference from average directory count per flex block
group with flex block group size as we do with other metrics.

Tested-by: Stefan Wahren <stefan.wahren@i2se.com>
Tested-by: Ojaswin Mujoo <ojaswin@linux.ibm.com>
Signed-off-by: Jan Kara <jack@suse.cz>
---
 fs/ext4/ialloc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c
index f73e5eb43eae..208b87ce8858 100644
--- a/fs/ext4/ialloc.c
+++ b/fs/ext4/ialloc.c
@@ -510,7 +510,7 @@ static int find_group_orlov(struct super_block *sb, struct inode *parent,
 		goto fallback;
 	}
 
-	max_dirs = ndirs / ngroups + inodes_per_group / 16;
+	max_dirs = ndirs / ngroups + inodes_per_group*flex_size / 16;
 	min_inodes = avefreei - inodes_per_group*flex_size / 4;
 	if (min_inodes < 1)
 		min_inodes = 1;
-- 
2.35.3


  parent reply	other threads:[~2022-09-08  9:23 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-08  9:21 [PATCH 0/5 v3] ext4: Fix performance regression with mballoc Jan Kara
2022-09-08  9:21 ` [PATCH 1/5] ext4: Make mballoc try target group first even with mb_optimize_scan Jan Kara
2022-09-22  2:52   ` Theodore Ts'o
2022-09-22  9:15     ` Jan Kara
2022-09-26  9:11       ` Jan Kara
2022-09-26 17:32         ` Theodore Ts'o
2022-09-08  9:21 ` [PATCH 2/5] ext4: Avoid unnecessary spreading of allocations among groups Jan Kara
2022-09-08  9:21 ` Jan Kara [this message]
2022-09-08  9:21 ` [PATCH 4/5] ext4: Use locality group preallocation for small closed files Jan Kara
2022-09-08  9:21 ` [PATCH 5/5] ext4: Use buckets for cr 1 block scan instead of rbtree Jan Kara
2022-09-09  6:12   ` Ritesh Harjani (IBM)
2022-09-08 10:36 ` [PATCH 0/5 v3] ext4: Fix performance regression with mballoc Stefan Wahren
2022-09-09 10:40   ` Jan Kara
2022-09-11 12:32     ` Stefan Wahren
  -- strict thread matches above, loose matches on Subject: below --
2022-09-06 15:29 [PATCH 0/5 v2] " Jan Kara
2022-09-06 15:29 ` [PATCH 3/5] ext4: Make directory inode spreading reflect flexbg size Jan Kara

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=20220908092136.11770-3-jack@suse.cz \
    --to=jack@suse.cz \
    --cc=harshadshirwadkar@gmail.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=ojaswin@linux.ibm.com \
    --cc=regressions@leemhuis.info \
    --cc=stefan.wahren@i2se.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.