lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 14 Feb 2023 01:23:44 +0530
From:   Ojaswin Mujoo <ojaswin@...ux.ibm.com>
To:     Kemeng Shi <shikemeng@...weicloud.com>
Cc:     tytso@....edu, adilger.kernel@...ger.ca, jack@...e.cz,
        linux-ext4@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 15/21] ext4: use best found when complex scan of group
 finishs

On Fri, Feb 10, 2023 at 03:48:19AM +0800, Kemeng Shi wrote:
> If any bex which meets bex->fe_len >= gex->fe_len is found, then it will
> always be used when complex scan of group that bex belongs to finishs.
> So there will not be any lock-unlock period.
> 
> Signed-off-by: Kemeng Shi <shikemeng@...weicloud.com>
> ---
>  fs/ext4/mballoc.c | 14 ++------------
>  1 file changed, 2 insertions(+), 12 deletions(-)
> 
> diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
> index e53f84de5018..c684758d6dbb 100644
> --- a/fs/ext4/mballoc.c
> +++ b/fs/ext4/mballoc.c
> @@ -2019,8 +2019,6 @@ static void ext4_mb_check_limits(struct ext4_allocation_context *ac,
>  	struct ext4_sb_info *sbi = EXT4_SB(ac->ac_sb);
>  	struct ext4_free_extent *bex = &ac->ac_b_ex;
>  	struct ext4_free_extent *gex = &ac->ac_g_ex;
> -	struct ext4_free_extent ex;
> -	int max;
>  
>  	if (ac->ac_status == AC_STATUS_FOUND)
>  		return;
> @@ -2039,16 +2037,8 @@ static void ext4_mb_check_limits(struct ext4_allocation_context *ac,
>  	if (bex->fe_len < gex->fe_len)
>  		return;
>  
> -	if (finish_group && bex->fe_group == e4b->bd_group) {
> -		/* recheck chunk's availability - we don't know
> -		 * when it was found (within this lock-unlock
> -		 * period or not) */
> -		max = mb_find_extent(e4b, bex->fe_start, gex->fe_len, &ex);
> -		if (max >= gex->fe_len) {
> -			ext4_mb_use_best_found(ac, e4b);
> -			return;
> -		}
> -	}
> +	if (finish_group)
> +		ext4_mb_use_best_found(ac, e4b);
>  }
>  
>  /*
> -- 
> 2.30.0
> 
Looks good. So when we have found bex > gex, then we wont have a lock
unlock period since we always allocate the bex when we reach the end of
group. 

Just a small typo in the commit message (finshs -> finishes), but other
than that feel free to add:

Reviewed-by: Ojaswin Mujoo <ojaswin@...ux.ibm.com> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ