public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Ojaswin Mujoo <ojaswin@linux.ibm.com>
Cc: linux-ext4@vger.kernel.org, Theodore Ts'o <tytso@mit.edu>,
	Ritesh Harjani <riteshh@linux.ibm.com>,
	linux-kernel@vger.kernel.org, Jan Kara <jack@suse.cz>,
	Kemeng Shi <shikemeng@huaweicloud.com>
Subject: Re: [PATCH] ext4: Replace CR_FAST macro with inline function for readability
Date: Thu, 29 Jun 2023 16:00:18 +0200	[thread overview]
Message-ID: <20230629140018.duaaxqnxe55yfvqq@quack3> (raw)
In-Reply-To: <20230629134719.108104-1-ojaswin@linux.ibm.com>

On Thu 29-06-23 19:17:19, Ojaswin Mujoo wrote:
> Replace CR_FAST with ext4_mb_cr_expensive() inline function for better
> readability. This function returns true if the criteria is one of the
> expensive/slower ones where lots of disk IO/prefetching is acceptable.
> 
> No functional changes are intended in this patch.
> 
> Signed-off-by: Ojaswin Mujoo <ojaswin@linux.ibm.com>

Thanks for this cleanup! Feel free to add:

Reviewed-by: Jan Kara <jack@suse.cz>

Just one suggestion for consideration below:

> @@ -2630,7 +2630,7 @@ static int ext4_mb_good_group_nolock(struct ext4_allocation_context *ac,
>  	free = grp->bb_free;
>  	if (free == 0)
>  		goto out;
> -	if (cr <= CR_FAST && free < ac->ac_g_ex.fe_len)
> +	if (cr <= CR_GOAL_LEN_SLOW && free < ac->ac_g_ex.fe_len)

Maybe this could be (!ext4_mb_cr_expensive(cr) || cr == CR_GOAL_LEN_SLOW)?
Or maybe more explanatory would be (cr < CR_ANY_FREE) because AFAIU that's
the only scan where we bother scanning groups that have no chance of
satisfying the full allocation? Anyway a short comment explaining this
might be useful. And in either case we can get rid of a bit confusing
CR_FAST define.

								Honza
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

  reply	other threads:[~2023-06-29 14:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-29 13:47 [PATCH] ext4: Replace CR_FAST macro with inline function for readability Ojaswin Mujoo
2023-06-29 14:00 ` Jan Kara [this message]
2023-06-29 14:41   ` Ojaswin Mujoo

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=20230629140018.duaaxqnxe55yfvqq@quack3 \
    --to=jack@suse.cz \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ojaswin@linux.ibm.com \
    --cc=riteshh@linux.ibm.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