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]
Message-ID: <0bcfc7c6-003f-4b4d-ac65-e01308a74f3b@huawei.com>
Date: Mon, 30 Jun 2025 11:32:16 +0800
From: Baokun Li <libaokun1@...wei.com>
To: Jan Kara <jack@...e.cz>
CC: <linux-ext4@...r.kernel.org>, <tytso@....edu>, <adilger.kernel@...ger.ca>,
	<ojaswin@...ux.ibm.com>, <linux-kernel@...r.kernel.org>,
	<yi.zhang@...wei.com>, <yangerkun@...wei.com>, Baokun Li
	<libaokun1@...wei.com>
Subject: Re: [PATCH v2 02/16] ext4: remove unnecessary s_mb_last_start

On 2025/6/28 2:15, Jan Kara wrote:
> On Mon 23-06-25 15:32:50, Baokun Li wrote:
>> ac->ac_g_ex.fe_start is only used in ext4_mb_find_by_goal(), but STREAM
>> ALLOC is activated after ext4_mb_find_by_goal() fails, so there's no need
>> to update ac->ac_g_ex.fe_start, remove the unnecessary s_mb_last_start.
>>
>> Signed-off-by: Baokun Li <libaokun1@...wei.com>
> I'd just note that ac->ac_g_ex.fe_start is also used in
> ext4_mb_collect_stats() so this change may impact the statistics gathered
> there. OTOH it is questionable whether we even want to account streaming
> allocation as a goal hit... Anyway, I'm fine with this, I'd just mention it
> in the changelog.
Yes, I missed ext4_mb_collect_stats(). However, instead of explaining
it in the changelog, I think it would be better to move the current
s_bal_goals update to inside or after ext4_mb_find_by_goal().

Then, we could add another variable, such as s_bal_stream_goals, to
represent the hit count for global goals. This kind of statistic would
help us fine-tune the logic for optimizing inode goals and global goals.

What are your thoughts on this?
> Also one nit below but feel free to add:
>
> Reviewed-by: Jan Kara <jack@...e.cz>
Thanks for your review!
>
>> @@ -2849,7 +2848,6 @@ ext4_mb_regular_allocator(struct ext4_allocation_context *ac)
>>   		/* TBD: may be hot point */
>>   		spin_lock(&sbi->s_md_lock);
>>   		ac->ac_g_ex.fe_group = sbi->s_mb_last_group;
>> -		ac->ac_g_ex.fe_start = sbi->s_mb_last_start;
> Maybe reset ac->ac_g_ex.fe_start to 0 instead of leaving it at some random
> value? Just for the sake of defensive programming...
>
> 								Honza

ac->ac_g_ex.fe_start holds the inode goal's start position, not a random
value. It's unused after ext4_mb_find_by_goal() (if s_bal_stream_goals is
added). Thus, I see no need for further modification. We can always re-add
it if future requirements change.


Thanks,
Baokun


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ