All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hou Tao <houtao@huaweicloud.com>
To: Jan Kara <jack@suse.cz>
Cc: linux-block@vger.kernel.org, Bart Van Assche <bvanassche@acm.org>,
	Bagas Sanjaya <bagasdotme@gmail.com>,
	Jens Axboe <axboe@kernel.dk>,
	cgroups@vger.kernel.org, Tejun Heo <tj@kernel.org>,
	Zefan Li <lizefan.x@bytedance.com>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Jonathan Corbet <corbet@lwn.net>,
	linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org,
	houtao1@huawei.com
Subject: Re: [PATCH v2] blk-ioprio: Introduce promote-to-rt policy
Date: Mon, 27 Feb 2023 21:56:25 +0800	[thread overview]
Message-ID: <05eafc4f-2d60-b7e6-1d5d-9a08709916e8@huaweicloud.com> (raw)
In-Reply-To: <20230227130305.2idxwmz2kdnacolc@quack3>

Hi

On 2/27/2023 9:03 PM, Jan Kara wrote:
> On Mon 20-02-23 21:54:28, Hou Tao wrote:
>> From: Hou Tao <houtao1@huawei.com>
>>
>> Since commit a78418e6a04c ("block: Always initialize bio IO priority on
>> submit"), bio->bi_ioprio will never be IOPRIO_CLASS_NONE when calling
>> blkcg_set_ioprio(), so there will be no way to promote the io-priority
>> of one cgroup to IOPRIO_CLASS_RT, because bi_ioprio will always be
>> greater than or equals to IOPRIO_CLASS_RT.
>>
>> It seems possible to call blkcg_set_ioprio() first then try to
>> initialize bi_ioprio later in bio_set_ioprio(), but this doesn't work
>> for bio in which bi_ioprio is already initialized (e.g., direct-io), so
>> introduce a new ioprio policy to promote the iopriority of bio to
>> IOPRIO_CLASS_RT if the ioprio is not already RT.
>>
>> So introduce a new promote-to-rt policy to achieve this. For none-to-rt
>> policy, although it doesn't work now, but considering that its purpose
>> was also to override the io-priority to RT and allow for a smoother
>> transition, just keep it and treat it as an alias of the promote-to-rt
>> policy.
>>
>> Signed-off-by: Hou Tao <houtao1@huawei.com>
> Looks good to me. Feel free to add:
>
> Reviewed-by: Jan Kara <jack@suse.cz>
Thanks for the review.
>
> Just one question regarding doc below:
>
>> ++----------------+---+
>> +| no-change      | 0 |
>> ++----------------+---+
>> +| rt-to-be       | 2 |
>> ++----------------+---+
>> +| all-to-idle    | 3 |
>> ++----------------+---+
> Shouldn't there be preempt-to-rt somewhere in this table as well? Or why
> this this in the doc at all? I'd consider the numbers to be kernel internal
> thing?
These numbers are used in the algorithm paragraph below to explain how the final
ioprio is calculated. For prompt-to-rt policy, the algorithm is different and
the number is unnecessary.

> 								Honza


  reply	other threads:[~2023-02-27 13:56 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-20 13:54 [PATCH v2] blk-ioprio: Introduce promote-to-rt policy Hou Tao
2023-02-20 13:54 ` Hou Tao
2023-02-21 16:37 ` Tejun Heo
2023-02-21 17:27 ` Bart Van Assche
2023-02-21 18:04 ` Chaitanya Kulkarni
2023-02-22  7:38 ` Bagas Sanjaya
2023-02-22  7:38   ` Bagas Sanjaya
2023-02-23  1:08   ` Hou Tao
2023-02-23  1:08     ` Hou Tao
2023-02-27 13:03 ` Jan Kara
2023-02-27 13:56   ` Hou Tao [this message]
2023-02-27 15:02     ` Jan Kara

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=05eafc4f-2d60-b7e6-1d5d-9a08709916e8@huaweicloud.com \
    --to=houtao@huaweicloud.com \
    --cc=axboe@kernel.dk \
    --cc=bagasdotme@gmail.com \
    --cc=bvanassche@acm.org \
    --cc=cgroups@vger.kernel.org \
    --cc=corbet@lwn.net \
    --cc=hannes@cmpxchg.org \
    --cc=houtao1@huawei.com \
    --cc=jack@suse.cz \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizefan.x@bytedance.com \
    --cc=tj@kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.