From: Yu Kuai <yukuai1@huaweicloud.com>
To: Christoph Hellwig <hch@lst.de>, Yu Kuai <yukuai1@huaweicloud.com>
Cc: tj@kernel.org, josef@toxicpanda.com, axboe@kernel.dk,
cgroups@vger.kernel.org, linux-block@vger.kernel.org,
linux-kernel@vger.kernel.org, yi.zhang@huawei.com,
yangerkun@huawei.com, "yukuai (C)" <yukuai3@huawei.com>
Subject: Re: [PATCH -next 1/6] blk-wbt: fix that wbt can't be disabled by default
Date: Fri, 12 May 2023 15:03:45 +0800 [thread overview]
Message-ID: <43cbe02a-a4bd-7e6b-6b3c-c35b2e045136@huaweicloud.com> (raw)
In-Reply-To: <20230511151919.GA7880@lst.de>
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
>
>
> .
>
next prev parent reply other threads:[~2023-05-12 7:04 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-11 1:45 [PATCH -next 0/6] blk-wbt: minor fix and cleanup Yu Kuai
2023-05-11 1:45 ` [PATCH -next 1/6] blk-wbt: fix that wbt can't be disabled by default Yu Kuai
2023-05-11 15:19 ` Christoph Hellwig
2023-05-12 7:03 ` Yu Kuai [this message]
2023-05-11 1:45 ` [PATCH -next 2/6] blk-wbt: don't create wbt sysfs entry if CONFIG_BLK_WBT is disabled Yu Kuai
2023-05-11 15:19 ` Christoph Hellwig
2023-05-11 1:45 ` [PATCH -next 3/6] blk-wbt: don't enable wbt for bio based device Yu Kuai
2023-05-11 15:21 ` Christoph Hellwig
2023-05-12 7:06 ` Yu Kuai
2023-05-11 1:45 ` [PATCH -next 4/6] blk-wbt: remove deadcode to handle wbt enable/disable with io inflight Yu Kuai
2023-05-11 15:21 ` Christoph Hellwig
2023-05-11 1:45 ` [PATCH -next 5/6] blk-wbt: cleanup rwb_enabled() and wbt_disabled() Yu Kuai
2023-05-11 15:23 ` Christoph Hellwig
2023-05-12 7:07 ` Yu Kuai
2023-05-11 1:45 ` [PATCH -next 6/6] blk-iocost: move wbt_enable/disable_default() out of spinlock Yu Kuai
2023-05-11 15:25 ` Christoph Hellwig
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=43cbe02a-a4bd-7e6b-6b3c-c35b2e045136@huaweicloud.com \
--to=yukuai1@huaweicloud.com \
--cc=axboe@kernel.dk \
--cc=cgroups@vger.kernel.org \
--cc=hch@lst.de \
--cc=josef@toxicpanda.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tj@kernel.org \
--cc=yangerkun@huawei.com \
--cc=yi.zhang@huawei.com \
--cc=yukuai3@huawei.com \
/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
all inboxes | Powered by JetHome®