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: Mon, 3 Jun 2024 14:39:18 +0800
From: Kemeng Shi <shikemeng@...weicloud.com>
To: Tejun Heo <tj@...nel.org>
Cc: willy@...radead.org, akpm@...ux-foundation.org,
 linux-fsdevel@...r.kernel.org, linux-mm@...ck.org,
 linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 8/8] writeback: factor out balance_wb_limits to remove
 repeated code


Hello,
on 5/31/2024 2:33 AM, Tejun Heo wrote:
> Hello,
> 
> On Tue, May 14, 2024 at 08:52:54PM +0800, Kemeng Shi wrote:
>> +static void balance_wb_limits(struct dirty_throttle_control *dtc,
>> +			      bool strictlimit)
>> +{
>> +	wb_dirty_freerun(dtc, strictlimit);
>> +	if (dtc->freerun)
>> +		return;
>> +
>> +	wb_dirty_exceeded(dtc, strictlimit);
>> +	wb_position_ratio(dtc);
>> +}
> ...
>> @@ -1869,12 +1880,9 @@ static int balance_dirty_pages(struct bdi_writeback *wb,
>>  		 * Calculate global domain's pos_ratio and select the
>>  		 * global dtc by default.
>>  		 */
>> -		wb_dirty_freerun(gdtc, strictlimit);
>> +		balance_wb_limits(gdtc, strictlimit);
>>  		if (gdtc->freerun)
>>  			goto free_running;
>> -
>> -		wb_dirty_exceeded(gdtc, strictlimit);
>> -		wb_position_ratio(gdtc);
>>  		sdtc = gdtc;
> 
> Isn't this a bit nasty? The helper skips updating states because it knows
> the caller is not going to use them? I'm not sure the slight code reduction
> justifies the added subtlety.

It's a general rule that wb should not be limited if the wb is in freerun state.
So I think it's intuitive to obey the rule in both balance_wb_limits and it's
caller in which case balance_wb_limits and it's caller should stop to do anything
when freerun state of wb is first seen.
But no insistant on this...

Thanks.
> 
> Thanks.
> 


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ