From: Jan Kara <jack@suse.cz>
To: Kemeng Shi <shikemeng@huaweicloud.com>
Cc: tytso@mit.edu, adilger.kernel@dilger.ca,
linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org,
jack@suse.cz, ojaswin@linux.ibm.com, ritesh.list@gmail.com
Subject: Re: [PATCH 4/5] ext4: use correct criteria name instead stale integer number in comment
Date: Thu, 4 Apr 2024 16:19:02 +0200 [thread overview]
Message-ID: <20240404141902.t5ut465q7vxusoa6@quack3> (raw)
In-Reply-To: <20240326213823.528302-5-shikemeng@huaweicloud.com>
On Wed 27-03-24 05:38:22, Kemeng Shi wrote:
> Use correct criteria name instead stale integer number in comment
>
> Signed-off-by: Kemeng Shi <shikemeng@huaweicloud.com>
Looks good. But since the symbolic names already have CR prefix, we
probably don't have to write e.g.:
/* Large fragment size list lookup succeeded at least once for cr =
* CR_POWER2_ALIGNED */
But we can write directly:
/* Large fragment size list lookup succeeded at least once for
* CR_POWER2_ALIGNED */
Honza
> ---
> fs/ext4/ext4.h | 15 ++++++++++++---
> fs/ext4/mballoc.c | 14 ++++++++------
> fs/ext4/mballoc.h | 4 ++--
> 3 files changed, 22 insertions(+), 11 deletions(-)
>
> diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
> index 023571f8dd1b..9b90013c59a3 100644
> --- a/fs/ext4/ext4.h
> +++ b/fs/ext4/ext4.h
> @@ -213,11 +213,20 @@ enum criteria {
> #define EXT4_MB_USE_RESERVED 0x2000
> /* Do strict check for free blocks while retrying block allocation */
> #define EXT4_MB_STRICT_CHECK 0x4000
> -/* Large fragment size list lookup succeeded at least once for cr = 0 */
> +/*
> + * Large fragment size list lookup succeeded at least once for cr =
> + * CR_POWER2_ALIGNED
> + */
> #define EXT4_MB_CR_POWER2_ALIGNED_OPTIMIZED 0x8000
> -/* Avg fragment size rb tree lookup succeeded at least once for cr = 1 */
> +/*
> + * Avg fragment size rb tree lookup succeeded at least once for cr =
> + * CR_GOAL_LEN_FAST
> + */
> #define EXT4_MB_CR_GOAL_LEN_FAST_OPTIMIZED 0x00010000
> -/* Avg fragment size rb tree lookup succeeded at least once for cr = 1.5 */
> +/*
> + * Avg fragment size rb tree lookup succeeded at least once for cr =
> + * CR_BEST_AVAIL_LEN
> + */
> #define EXT4_MB_CR_BEST_AVAIL_LEN_OPTIMIZED 0x00020000
>
> struct ext4_allocation_request {
> diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
> index 62d468379722..0f8a34513bf6 100644
> --- a/fs/ext4/mballoc.c
> +++ b/fs/ext4/mballoc.c
> @@ -1131,8 +1131,9 @@ static void ext4_mb_choose_next_group(struct ext4_allocation_context *ac,
> ext4_mb_choose_next_group_best_avail(ac, new_cr, group);
> } else {
> /*
> - * TODO: For CR=2, we can arrange groups in an rb tree sorted by
> - * bb_free. But until that happens, we should never come here.
> + * TODO: For CR=CR_GOAL_LEN_SLOW, we can arrange groups in an
> + * rb tree sorted by bb_free. But until that happens, we should
> + * never come here.
> */
> WARN_ON(1);
> }
> @@ -3444,10 +3445,11 @@ static int ext4_mb_init_backend(struct super_block *sb)
> }
> if (sbi->s_mb_prefetch > ext4_get_groups_count(sb))
> sbi->s_mb_prefetch = ext4_get_groups_count(sb);
> - /* now many real IOs to prefetch within a single allocation at cr=0
> - * given cr=0 is an CPU-related optimization we shouldn't try to
> - * load too many groups, at some point we should start to use what
> - * we've got in memory.
> + /*
> + * now many real IOs to prefetch within a single allocation at
> + * cr=CR_POWER2_ALIGNED. Given cr=CR_POWER2_ALIGNED is an CPU-related
> + * optimization we shouldn't try to load too many groups, at some point
> + * we should start to use what we've got in memory.
> * with an average random access time 5ms, it'd take a second to get
> * 200 groups (* N with flex_bg), so let's make this limit 4
> */
> diff --git a/fs/ext4/mballoc.h b/fs/ext4/mballoc.h
> index 56938532b4ce..042437d8860f 100644
> --- a/fs/ext4/mballoc.h
> +++ b/fs/ext4/mballoc.h
> @@ -187,8 +187,8 @@ struct ext4_allocation_context {
> struct ext4_free_extent ac_f_ex;
>
> /*
> - * goal len can change in CR1.5, so save the original len. This is
> - * used while adjusting the PA window and for accounting.
> + * goal len can change in CR_BEST_AVAIL_LEN, so save the original len.
> + * This is used while adjusting the PA window and for accounting.
> */
> ext4_grpblk_t ac_orig_goal_len;
>
> --
> 2.30.0
>
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
next prev parent reply other threads:[~2024-04-04 14:19 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-26 21:38 [PATCH 0/5] Minor improvements and cleanups to ext4 mballoc Kemeng Shi
2024-03-26 21:38 ` [PATCH 1/5] ext4: keep "prefetch_grp" and "nr" consistent Kemeng Shi
2024-03-29 7:52 ` Ojaswin Mujoo
2024-04-04 13:22 ` Jan Kara
2024-03-26 21:38 ` [PATCH 2/5] ext4: add test_mb_mark_used_cost to estimate cost of mb_mark_used Kemeng Shi
2024-03-29 7:26 ` kernel test robot
2024-03-26 21:38 ` [PATCH 3/5] ext4: call ext4_mb_mark_free_simple in mb_mark_used to clear bits Kemeng Shi
2024-04-04 14:16 ` Jan Kara
2024-04-07 6:31 ` Kemeng Shi
2024-03-26 21:38 ` [PATCH 4/5] ext4: use correct criteria name instead stale integer number in comment Kemeng Shi
2024-03-29 7:15 ` Ojaswin Mujoo
2024-04-04 14:19 ` Jan Kara [this message]
2024-04-07 3:21 ` Kemeng Shi
2024-03-26 21:38 ` [PATCH 5/5] ext4: expand next_linear_group to remove repeat check for linear scan Kemeng Shi
2024-03-29 7:14 ` Ojaswin Mujoo
2024-04-03 6:57 ` Kemeng Shi
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=20240404141902.t5ut465q7vxusoa6@quack3 \
--to=jack@suse.cz \
--cc=adilger.kernel@dilger.ca \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ojaswin@linux.ibm.com \
--cc=ritesh.list@gmail.com \
--cc=shikemeng@huaweicloud.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