public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Yu Kuai <yukuai1@huaweicloud.com>
Cc: hch@lst.de, tj@kernel.org, josef@toxicpanda.com, axboe@kernel.dk,
	yukuai3@huawei.com, cgroups@vger.kernel.org,
	linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
	yi.zhang@huawei.com, yangerkun@huawei.com
Subject: Re: [PATCH -next 1/6] blk-wbt: fix that wbt can't be disabled by default
Date: Thu, 11 May 2023 17:19:19 +0200	[thread overview]
Message-ID: <20230511151919.GA7880@lst.de> (raw)
In-Reply-To: <20230511014509.679482-2-yukuai1@huaweicloud.com>

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;


  reply	other threads:[~2023-05-11 15:19 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 [this message]
2023-05-12  7:03     ` Yu Kuai
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=20230511151919.GA7880@lst.de \
    --to=hch@lst.de \
    --cc=axboe@kernel.dk \
    --cc=cgroups@vger.kernel.org \
    --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=yukuai1@huaweicloud.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