[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZLQOrNLIsCC7aeuS@li-bb2b2a4c-3307-11b2-a85c-8fa5c3a69313.ibm.com>
Date: Sun, 16 Jul 2023 21:07:16 +0530
From: Ojaswin Mujoo <ojaswin@...ux.ibm.com>
To: "Ritesh Harjani (IBM)" <ritesh.list@...il.com>
Cc: linux-ext4@...r.kernel.org, Eric Whitney <enwlinux@...il.com>
Subject: Re: [PATCH] ext4: Don't use CR_BEST_AVAIL_LEN for non-regular files
On Sun, Jul 16, 2023 at 07:33:34PM +0530, Ritesh Harjani (IBM) wrote:
> Using CR_BEST_AVAIL_LEN only make sense for regular files, as for
> non-regular files we never normalize the allocation request length i.e.
> goal len is same as original length (ac_g_ex.fe_len == ac_o_ex.fe_len).
>
> Hence there is no scope of trimming the goal length to make it
> satisfy original request len. Thus this patch avoids using
> CR_BEST_AVAIL_LEN criteria for non-regular files request.
>
> Fixes: 33122aa930f1 ("ext4: Add allocation criteria 1.5 (CR1_5)")
> Reported-by: Eric Whitney <enwlinux@...il.com>
> Signed-off-by: Ritesh Harjani (IBM) <ritesh.list@...il.com>
> ---
Hi Ritesh,
patch looks good to me. Feel free to add:
Reviewed-by: Ojaswin Mujoo <ojaswin.linux.ibm.com>
Regards,
ojaswin
> fs/ext4/mballoc.c | 13 ++++++++++++-
> 1 file changed, 12 insertions(+), 1 deletion(-)
>
> diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
> index 3ab37533349f..bc004f5d3f3c 100644
> --- a/fs/ext4/mballoc.c
> +++ b/fs/ext4/mballoc.c
> @@ -975,7 +975,18 @@ static void ext4_mb_choose_next_group_goal_fast(struct ext4_allocation_context *
> *group = grp->bb_group;
> ac->ac_flags |= EXT4_MB_CR_GOAL_LEN_FAST_OPTIMIZED;
> } else {
> - *new_cr = CR_BEST_AVAIL_LEN;
> + /*
> + * CR_BEST_AVAIL_LEN works based on the concept that we have
> + * a larger normalized goal len request which can be trimmed to
> + * a smaller goal len such that it can still satisfy original
> + * request len. However, allocation request for non-regular
> + * files never gets normalized.
> + * See function ext4_mb_normalize_request() (EXT4_MB_HINT_DATA).
> + */
> + if (ac->ac_flags & EXT4_MB_HINT_DATA)
> + *new_cr = CR_BEST_AVAIL_LEN;
> + else
> + *new_cr = CR_GOAL_LEN_SLOW;
> }
> }
>
> --
> 2.40.1
>
Powered by blists - more mailing lists