linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
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>,
	Harshad Shirwadkar <harshadshirwadkar@gmail.com>,
	stable@vger.kernel.org
Subject: Re: [PATCH 5/5] ext4: Use buckets for cr 1 block scan instead of rbtree
Date: Fri, 9 Sep 2022 11:42:39 +0530	[thread overview]
Message-ID: <20220909061239.unsikxp655mdt6wz@riteshh-domain> (raw)
In-Reply-To: <20220908092136.11770-5-jack@suse.cz>

On 22/09/08 11:21AM, Jan Kara wrote:
> Using rbtree for sorting groups by average fragment size is relatively
> expensive (needs rbtree update on every block freeing or allocation) and
> leads to wide spreading of allocations because selection of block group
> is very sentitive both to changes in free space and amount of blocks
> allocated. Furthermore selecting group with the best matching average
> fragment size is not necessary anyway, even more so because the
> variability of fragment sizes within a group is likely large so average
> is not telling much. We just need a group with large enough average
> fragment size so that we have high probability of finding large enough
> free extent and we don't want average fragment size to be too big so
> that we are likely to find free extent only somewhat larger than what we
> need.
> 
> So instead of maintaing rbtree of groups sorted by fragment size keep
> bins (lists) or groups where average fragment size is in the interval
> [2^i, 2^(i+1)). This structure requires less updates on block allocation
> / freeing, generally avoids chaotic spreading of allocations into block
> groups, and still is able to quickly (even faster that the rbtree)
> provide a block group which is likely to have a suitably sized free
> space extent.
> 
> This patch reduces number of block groups used when untarring archive
> with medium sized files (size somewhat above 64k which is default
> mballoc limit for avoiding locality group preallocation) to about half
> and thus improves write speeds for eMMC flash significantly.
> 
> Fixes: 196e402adf2e ("ext4: improve cr 0 / cr 1 group scanning")
> CC: stable@vger.kernel.org
> Reported-and-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/ext4.h    |  10 +-
>  fs/ext4/mballoc.c | 249 ++++++++++++++++++++--------------------------
>  fs/ext4/mballoc.h |   1 -
>  3 files changed, 111 insertions(+), 149 deletions(-)

Hello Jan, 

I have reviewed the patch and also verified bb_fragments. That indeed will 
atleast be 1 (ext4_mb_generate_buddy()) as you had mentioned.

The patch looks good to me. Please feel free to add: 
Reviewed-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>


  reply	other threads:[~2022-09-09  6:12 UTC|newest]

Thread overview: 22+ 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 ` [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) [this message]
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 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

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=20220909061239.unsikxp655mdt6wz@riteshh-domain \
    --to=ritesh.list@gmail.com \
    --cc=harshadshirwadkar@gmail.com \
    --cc=jack@suse.cz \
    --cc=linux-ext4@vger.kernel.org \
    --cc=ojaswin@linux.ibm.com \
    --cc=regressions@leemhuis.info \
    --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;
as well as URLs for NNTP newsgroup(s).