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:   Fri, 12 May 2023 15:03:45 +0800
From:   Yu Kuai <yukuai1@...weicloud.com>
To:     Christoph Hellwig <hch@....de>, Yu Kuai <yukuai1@...weicloud.com>
Cc:     tj@...nel.org, josef@...icpanda.com, axboe@...nel.dk,
        cgroups@...r.kernel.org, linux-block@...r.kernel.org,
        linux-kernel@...r.kernel.org, yi.zhang@...wei.com,
        yangerkun@...wei.com, "yukuai (C)" <yukuai3@...wei.com>
Subject: Re: [PATCH -next 1/6] blk-wbt: fix that wbt can't be disabled by
 default

Hi,

在 2023/05/11 23:19, Christoph Hellwig 写道:
> On Thu, May 11, 2023 at 09:45:04AM +0800, Yu Kuai wrote:
>> @@ -730,8 +730,9 @@ void wbt_enable_default(struct gendisk *disk)
>>   {
>>   	struct request_queue *q = disk->queue;
>>   	struct rq_qos *rqos;
>> -	bool disable_flag = q->elevator &&
>> -		    test_bit(ELEVATOR_FLAG_DISABLE_WBT, &q->elevator->flags);
>> +	bool disable_flag = (q->elevator &&
>> +		    test_bit(ELEVATOR_FLAG_DISABLE_WBT, &q->elevator->flags)) ||
>> +		    !IS_ENABLED(CONFIG_BLK_WBT_MQ);
> 
> Not really new in your patch, but I find the logic here very confusing.
> First the disable_flag really should be enable instead, as that's how
> it's actually checked, and then spelling out the conditions a bit more
> would really help readability.  E.g.
> 
> 	bool enabled = IS_ENABLED(CONFIG_BLK_WBT_MQ);
> 
> 	if (q->elevator &&
> 	    test_bit(ELEVATOR_FLAG_DISABLE_WBT, &q->elevator->flags))
> 		enable = false;

Of course, this looks better, I'll do this in v2.

Thanks,
Kuai
> 
> 
> .
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ