From: "Ritesh Harjani (IBM)" <ritesh.list@gmail.com>
To: Jan Kara <jack@suse.cz>
Cc: Ted Tso <tytso@mit.edu>,
linux-ext4@vger.kernel.org,
Thorsten Leemhuis <regressions@leemhuis.info>,
Ojaswin Mujoo <ojaswin@linux.ibm.com>,
Stefan Wahren <stefan.wahren@i2se.com>,
Andreas Dilger <adilger.kernel@dilger.ca>
Subject: Re: [PATCH 2/5] ext4: Avoid unnecessary spreading of allocations among groups
Date: Wed, 7 Sep 2022 23:35:07 +0530 [thread overview]
Message-ID: <20220907180507.3byq5uts42e6dpkn@riteshh-domain> (raw)
In-Reply-To: <20220906152920.25584-2-jack@suse.cz>
On 22/09/06 05:29PM, Jan Kara wrote:
> mb_set_largest_free_order() updates lists containing groups with largest
> chunk of free space of given order. The way it updates it leads to
> always moving the group to the tail of the list. Thus allocations
> looking for free space of given order effectively end up cycling through
> all groups (and due to initialization in last to first order). This
> spreads allocations among block groups which reduces performance for
> rotating disks or low-end flash media. Change
> mb_set_largest_free_order() to only update lists if the order of the
> largest free chunk in the group changed.
Nice and clear explaination. Thanks :)
This change also looks good to me.
Reviewed-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
One other thought to further optimize -
Will it make a difference if rather then adding the group to the tail of the list,
we add that group to the head of sbi->s_mb_largest_free_orders[new_order].
This is because this group is the latest from where blocks were allocated/freed,
and hence the next allocation should first try from this group in order to keep
the files/extents blocks close to each other?
(That sometimes might help with disk firmware to avoid doing discards if the freed
block can be reused?)
Or does goal block will always cover that case by default and we might never
require this? Maybe in a case of a new file within the same directory where
the goal group has no free blocks, but the last group attempted should be
retried first?
-ritesh
next prev parent reply other threads:[~2022-09-07 18:05 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-06 15:29 [PATCH 0/5 v2] ext4: Fix performance regression with mballoc 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)
2022-09-06 15:29 ` [PATCH 2/5] ext4: Avoid unnecessary spreading of allocations among groups Jan Kara
2022-09-07 18:05 ` Ritesh Harjani (IBM) [this message]
2022-09-08 8:57 ` Jan Kara
2022-09-08 9:24 ` Ritesh Harjani (IBM)
2022-09-06 15:29 ` [PATCH 3/5] ext4: Make directory inode spreading reflect flexbg size Jan Kara
2022-09-06 15:29 ` [PATCH 4/5] ext4: Use locality group preallocation for small closed files Jan Kara
2022-09-07 18:25 ` Ritesh Harjani (IBM)
2022-09-06 15:29 ` [PATCH 5/5] ext4: Use buckets for cr 1 block scan instead of rbtree Jan Kara
2022-09-07 18:41 ` Ritesh Harjani (IBM)
2022-09-08 9:01 ` Jan Kara
2022-09-08 9:23 ` Ritesh Harjani (IBM)
2022-09-08 8:29 ` Ojaswin Mujoo
2022-09-08 9:03 ` Jan Kara
2022-09-08 11:00 ` Dan Carpenter
2022-09-08 11:33 ` Jan Kara
2022-09-06 20:38 ` [PATCH 0/5 v2] ext4: Fix performance regression with mballoc Stefan Wahren
2022-09-07 10:49 ` Jan Kara
2022-09-07 13:02 ` Jan Kara
2022-09-08 8:17 ` Ojaswin Mujoo
2022-09-08 9:12 ` Jan Kara
-- strict thread matches above, loose matches on Subject: below --
2022-09-08 9:21 [PATCH 0/5 v3] " Jan Kara
2022-09-08 9:21 ` [PATCH 2/5] ext4: Avoid unnecessary spreading of allocations among groups 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=20220907180507.3byq5uts42e6dpkn@riteshh-domain \
--to=ritesh.list@gmail.com \
--cc=adilger.kernel@dilger.ca \
--cc=jack@suse.cz \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox