From: Jan Kara <jack@suse.cz>
To: Theodore Ts'o <tytso@mit.edu>
Cc: jack@suse.cz, harshadshirwadkar@gmail.com,
stable@vger.kernel.org, ritesh.list@gmail.com,
stefan.wahren@i2se.com, ojaswin@linux.ibm.com,
linux-ext4@vger.kernel.org, regressions@leemhuis.info
Subject: Re: [PATCH 1/5] ext4: Make mballoc try target group first even with mb_optimize_scan
Date: Thu, 22 Sep 2022 11:15:42 +0200 [thread overview]
Message-ID: <20220922091542.pkhedytey7wzp5fi@quack3> (raw)
In-Reply-To: <166381513758.2957616.15274082762134894004.b4-ty@mit.edu>
[-- Attachment #1: Type: text/plain, Size: 1458 bytes --]
On Wed 21-09-22 22:52:34, Theodore Ts'o wrote:
> On Thu, 8 Sep 2022 11:21:24 +0200, Jan Kara wrote:
> > One of the side-effects of mb_optimize_scan was that the optimized
> > functions to select next group to try were called even before we tried
> > the goal group. As a result we no longer allocate files close to
> > corresponding inodes as well as we don't try to expand currently
> > allocated extent in the same group. This results in reaim regression
> > with workfile.disk workload of upto 8% with many clients on my test
> > machine:
> >
> > [...]
>
> Applied, thanks!
>
> [1/5] ext4: Make mballoc try target group first even with mb_optimize_scan
> commit: 4fca50d440cc5d4dc570ad5484cc0b70b381bc2a
> [2/5] ext4: Avoid unnecessary spreading of allocations among groups
> commit: 1940265ede6683f6317cba0d428ce6505eaca944
> [3/5] ext4: Make directory inode spreading reflect flexbg size
> commit: 613c5a85898d1cd44e68f28d65eccf64a8ace9cf
> [4/5] ext4: Use locality group preallocation for small closed files
> commit: a9f2a2931d0e197ab28c6007966053fdababd53f
> [5/5] ext4: Use buckets for cr 1 block scan instead of rbtree
> commit: 83e80a6e3543f37f74c8e48a5f305b054b65ce2a
Thanks Ted! I just have locally a small fixup to the series that was reported
by Smatch. It is attached, either fold it into the last patch or just merge
it as a separate patch. Thanks!
Honza
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
[-- Attachment #2: 0001-ext4-Fixup-possible-uninitialized-variable-access-in.patch --]
[-- Type: text/x-patch, Size: 1475 bytes --]
From 8885b11fb253e08ecfa90a28beffb01719af84f5 Mon Sep 17 00:00:00 2001
From: Jan Kara <jack@suse.cz>
Date: Thu, 22 Sep 2022 11:09:29 +0200
Subject: [PATCH] ext4: Fixup possible uninitialized variable access in
ext4_mb_choose_next_group_cr1()
Variable 'grp' may be left uninitialized if there's no group with
suitable average fragment size (or larger). Fix the problem by
initializing it earlier.
Fixes: 83e80a6e3543 ("ext4: use buckets for cr 1 block scan instead of rbtree")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jan Kara <jack@suse.cz>
---
fs/ext4/mballoc.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
index 71f5b67d7f28..9dad93059945 100644
--- a/fs/ext4/mballoc.c
+++ b/fs/ext4/mballoc.c
@@ -910,7 +910,7 @@ static void ext4_mb_choose_next_group_cr1(struct ext4_allocation_context *ac,
int *new_cr, ext4_group_t *group, ext4_group_t ngroups)
{
struct ext4_sb_info *sbi = EXT4_SB(ac->ac_sb);
- struct ext4_group_info *grp, *iter;
+ struct ext4_group_info *grp = NULL, *iter;
int i;
if (unlikely(ac->ac_flags & EXT4_MB_CR1_OPTIMIZED)) {
@@ -927,7 +927,6 @@ static void ext4_mb_choose_next_group_cr1(struct ext4_allocation_context *ac,
read_unlock(&sbi->s_mb_avg_fragment_size_locks[i]);
continue;
}
- grp = NULL;
list_for_each_entry(iter, &sbi->s_mb_avg_fragment_size[i],
bb_avg_fragment_size_node) {
if (sbi->s_mb_stats)
--
2.35.3
next prev parent reply other threads:[~2022-09-22 9:15 UTC|newest]
Thread overview: 16+ 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 [this message]
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 ` [PATCH 3/5] ext4: Make directory inode spreading reflect flexbg size Jan Kara
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 1/5] ext4: Make mballoc try target group first even with mb_optimize_scan Jan Kara
2022-09-07 17:43 ` Ritesh Harjani (IBM)
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=20220922091542.pkhedytey7wzp5fi@quack3 \
--to=jack@suse.cz \
--cc=harshadshirwadkar@gmail.com \
--cc=linux-ext4@vger.kernel.org \
--cc=ojaswin@linux.ibm.com \
--cc=regressions@leemhuis.info \
--cc=ritesh.list@gmail.com \
--cc=stable@vger.kernel.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox