From: brookxu <brookxu.cn@gmail.com> To: paolo.valente@linaro.org, axboe@kernel.dk, tj@kernel.org Cc: linux-block@vger.kernel.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH v2 07/11] bfq: optimse IO injection for CLASS_RT Date: Fri, 12 Mar 2021 19:08:41 +0800 [thread overview] Message-ID: <ab86856f91a4734adf9cbf4212adfe2252ddbc57.1615527324.git.brookxu@tencent.com> (raw) In-Reply-To: <cover.1615517202.git.brookxu@tencent.com> In-Reply-To: <cover.1615527324.git.brookxu@tencent.com> From: Chunguang Xu <brookxu@tencent.com> CLASS_RT is more sensitive to latency, and IO injection will increase the CLASS_RT latency. For this reason, consider prohibiting the injection of async queue for CLASS_RT, and only the waker queue and other active queues belonging to CLASS_RT are allowed to inject. In this way, for CLASS_RT, both the advantages of inject and IO latency can be maintained. Signed-off-by: Chunguang Xu <brookxu@tencent.com> --- block/bfq-iosched.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c index 8af73473c45c..a5f13589df79 100644 --- a/block/bfq-iosched.c +++ b/block/bfq-iosched.c @@ -1965,6 +1965,9 @@ static void bfq_check_waker(struct bfq_data *bfqd, struct bfq_queue *bfqq, bfqd->last_completed_rq_bfqq == bfqq->waker_bfqq) return; + if (bfq_class_rt(bfqq) && !bfq_class_rt(bfqd->last_completed_rq_bfqq)) + return; + if (bfqd->last_completed_rq_bfqq != bfqq->tentative_waker_bfqq) { /* @@ -4391,6 +4394,9 @@ bfq_choose_bfqq_for_injection(struct bfq_data *bfqd) else limit = in_serv_bfqq->inject_limit; + if (bfq_class_rt(in_serv_bfqq) && !bfq_class_rt(bfqq)) + continue; + if (bfqd->rq_in_driver < limit) { bfqd->rqs_injected = true; return bfqq; @@ -4565,7 +4571,7 @@ static struct bfq_queue *bfq_select_queue(struct bfq_data *bfqd) * may not be minimized, because the waker queue may * happen to be served only after other queues. */ - if (async_bfqq && + if (async_bfqq && !bfq_class_rt(bfqq) && icq_to_bic(async_bfqq->next_rq->elv.icq) == bfqq->bic && bfq_serv_to_charge(async_bfqq->next_rq, async_bfqq) <= bfq_bfqq_budget_left(async_bfqq)) -- 2.30.0
WARNING: multiple messages have this Message-ID (diff)
From: brookxu <brookxu.cn-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> To: paolo.valente-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org, axboe-tSWWG44O7X1aa/9Udqfwiw@public.gmane.org, tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org Cc: linux-block-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Subject: [RFC PATCH v2 07/11] bfq: optimse IO injection for CLASS_RT Date: Fri, 12 Mar 2021 19:08:41 +0800 [thread overview] Message-ID: <ab86856f91a4734adf9cbf4212adfe2252ddbc57.1615527324.git.brookxu@tencent.com> (raw) In-Reply-To: <cover.1615517202.git.brookxu-1Nz4purKYjRBDgjK7y7TUQ@public.gmane.org> In-Reply-To: <cover.1615527324.git.brookxu-1Nz4purKYjRBDgjK7y7TUQ@public.gmane.org> From: Chunguang Xu <brookxu-1Nz4purKYjRBDgjK7y7TUQ@public.gmane.org> CLASS_RT is more sensitive to latency, and IO injection will increase the CLASS_RT latency. For this reason, consider prohibiting the injection of async queue for CLASS_RT, and only the waker queue and other active queues belonging to CLASS_RT are allowed to inject. In this way, for CLASS_RT, both the advantages of inject and IO latency can be maintained. Signed-off-by: Chunguang Xu <brookxu-1Nz4purKYjRBDgjK7y7TUQ@public.gmane.org> --- block/bfq-iosched.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c index 8af73473c45c..a5f13589df79 100644 --- a/block/bfq-iosched.c +++ b/block/bfq-iosched.c @@ -1965,6 +1965,9 @@ static void bfq_check_waker(struct bfq_data *bfqd, struct bfq_queue *bfqq, bfqd->last_completed_rq_bfqq == bfqq->waker_bfqq) return; + if (bfq_class_rt(bfqq) && !bfq_class_rt(bfqd->last_completed_rq_bfqq)) + return; + if (bfqd->last_completed_rq_bfqq != bfqq->tentative_waker_bfqq) { /* @@ -4391,6 +4394,9 @@ bfq_choose_bfqq_for_injection(struct bfq_data *bfqd) else limit = in_serv_bfqq->inject_limit; + if (bfq_class_rt(in_serv_bfqq) && !bfq_class_rt(bfqq)) + continue; + if (bfqd->rq_in_driver < limit) { bfqd->rqs_injected = true; return bfqq; @@ -4565,7 +4571,7 @@ static struct bfq_queue *bfq_select_queue(struct bfq_data *bfqd) * may not be minimized, because the waker queue may * happen to be served only after other queues. */ - if (async_bfqq && + if (async_bfqq && !bfq_class_rt(bfqq) && icq_to_bic(async_bfqq->next_rq->elv.icq) == bfqq->bic && bfq_serv_to_charge(async_bfqq->next_rq, async_bfqq) <= bfq_bfqq_budget_left(async_bfqq)) -- 2.30.0
next prev parent reply other threads:[~2021-03-12 11:09 UTC|newest] Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-03-12 11:08 [RFC PATCH v2 00/11] bfq: introduce bfq.ioprio for cgroup brookxu [not found] ` <cover.1615527324.git.brookxu@tencent.com> 2021-03-12 11:08 ` [RFC PATCH v2 01/11] bfq: introduce bfq_entity_to_bfqg helper method brookxu 2021-03-12 11:08 ` [RFC PATCH v2 02/11] bfq: convert the type of bfq_group.bfqd to bfq_data* brookxu 2021-03-12 11:08 ` [RFC PATCH v2 03/11] bfq: introduce bfq.ioprio for cgroup brookxu 2021-03-12 11:08 ` brookxu 2021-03-12 11:08 ` [RFC PATCH v2 04/11] bfq: limit the IO depth of idle_class to 1 brookxu 2021-03-12 11:08 ` brookxu 2021-03-12 11:08 ` [RFC PATCH v2 05/11] bfq: keep the minimun bandwidth for be_class brookxu 2021-03-12 11:08 ` [RFC PATCH v2 06/11] bfq: expire other class if CLASS_RT is waiting brookxu 2021-03-12 11:08 ` brookxu 2021-03-12 11:08 ` brookxu [this message] 2021-03-12 11:08 ` [RFC PATCH v2 07/11] bfq: optimse IO injection for CLASS_RT brookxu 2021-03-12 11:08 ` [RFC PATCH v2 08/11] bfq: disallow idle if CLASS_RT waiting for service brookxu 2021-03-12 11:08 ` brookxu 2021-03-12 11:08 ` [RFC PATCH v2 09/11] bfq: disallow merge CLASS_RT with other class brookxu 2021-03-12 11:08 ` brookxu 2021-03-12 11:08 ` [RFC PATCH v2 10/11] bfq: remove unnecessary initialization logic brookxu 2021-03-12 11:08 ` brookxu 2021-03-12 11:08 ` [RFC PATCH v2 11/11] bfq: optimize the calculation of bfq_weight_to_ioprio() brookxu 2021-03-21 11:04 ` [RFC PATCH v2 00/11] bfq: introduce bfq.ioprio for cgroup Paolo Valente 2021-03-22 5:44 ` brookxu
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=ab86856f91a4734adf9cbf4212adfe2252ddbc57.1615527324.git.brookxu@tencent.com \ --to=brookxu.cn@gmail.com \ --cc=axboe@kernel.dk \ --cc=cgroups@vger.kernel.org \ --cc=linux-block@vger.kernel.org \ --cc=linux-kernel@vger.kernel.org \ --cc=paolo.valente@linaro.org \ --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: linkBe 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.