linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
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: [PATCH v3 07/14] bfq: introduce better_fairness for container scene
Date: Thu, 25 Mar 2021 14:57:51 +0800	[thread overview]
Message-ID: <9d9566d30702268e1f270f0cf7e8b08444c127a6.1616649216.git.brookxu@tencent.com> (raw)
In-Reply-To: <cover.1616649216.git.brookxu@tencent.com>
In-Reply-To: <cover.1616649216.git.brookxu@tencent.com>

From: Chunguang Xu <brookxu@tencent.com>

In the container scenario, in addition to throughput, we
also pay attention to Qos. In order to better support this
scenario, we introduce the better_fairness mode here. In
this mode, we expect to control the Qos of each group
according to its priority better. Only add configuration
interface here

Signed-off-by: Chunguang Xu <brookxu@tencent.com>
---
 block/bfq-iosched.c | 22 ++++++++++++++++++++++
 block/bfq-iosched.h | 10 ++++++++++
 2 files changed, 32 insertions(+)

diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c
index ee8c457..e7bc5e2 100644
--- a/block/bfq-iosched.c
+++ b/block/bfq-iosched.c
@@ -6745,6 +6745,7 @@ static ssize_t __FUNC(struct elevator_queue *e, char *page)		\
 SHOW_FUNCTION(bfq_max_budget_show, bfqd->bfq_user_max_budget, 0);
 SHOW_FUNCTION(bfq_timeout_sync_show, bfqd->bfq_timeout, 1);
 SHOW_FUNCTION(bfq_strict_guarantees_show, bfqd->strict_guarantees, 0);
+SHOW_FUNCTION(bfq_better_fairness_show, bfqd->better_fairness, 0);
 SHOW_FUNCTION(bfq_low_latency_show, bfqd->low_latency, 0);
 #undef SHOW_FUNCTION
 
@@ -6886,6 +6887,26 @@ static ssize_t bfq_strict_guarantees_store(struct elevator_queue *e,
 	return count;
 }
 
+static ssize_t bfq_better_fairness_store(struct elevator_queue *e,
+				     const char *page, size_t count)
+{
+	struct bfq_data *bfqd = e->elevator_data;
+	unsigned long __data;
+	int ret;
+
+	ret = bfq_var_store(&__data, (page));
+	if (ret)
+		return ret;
+
+	if (__data > 1)
+		__data = 1;
+	if (__data == 0 && bfqd->better_fairness != 0)
+		bfq_end_wr(bfqd);
+	bfqd->better_fairness = __data;
+
+	return count;
+}
+
 static ssize_t bfq_low_latency_store(struct elevator_queue *e,
 				     const char *page, size_t count)
 {
@@ -6919,6 +6940,7 @@ static ssize_t bfq_low_latency_store(struct elevator_queue *e,
 	BFQ_ATTR(max_budget),
 	BFQ_ATTR(timeout_sync),
 	BFQ_ATTR(strict_guarantees),
+	BFQ_ATTR(better_fairness),
 	BFQ_ATTR(low_latency),
 	__ATTR_NULL
 };
diff --git a/block/bfq-iosched.h b/block/bfq-iosched.h
index f9ed1da..674de8b 100644
--- a/block/bfq-iosched.h
+++ b/block/bfq-iosched.h
@@ -672,6 +672,16 @@ struct bfq_data {
 	bool strict_guarantees;
 
 	/*
+	 * If there is no prio preemption, we force the device to
+	 * idle to ensure Qos. IO inject also has some additional
+	 * restrictions. The inject/merge queue should come from the
+	 * same class in the same group. Doing so will reduce the
+	 * throughput of the system, but it can better guarantee
+	 * the Qos of each group and real-time tasks.
+	 */
+	bool better_fairness;
+
+	/*
 	 * Last time at which a queue entered the current burst of
 	 * queues being activated shortly after each other; for more
 	 * details about this and the following parameters related to
-- 
1.8.3.1


  parent reply	other threads:[~2021-03-25  6:58 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-25  6:57 [PATCH v3 00/14] bfq: introduce bfq.ioprio for cgroup brookxu
2021-03-25  6:57 ` [PATCH v3 01/14] bfq: introduce bfq_entity_to_bfqg helper method brookxu
2021-03-25  6:57 ` [PATCH v3 02/14] bfq: convert the type of bfq_group.bfqd to bfq_data* brookxu
2021-03-25  6:57 ` [PATCH v3 03/14] bfq: introduce bfq.ioprio for cgroup brookxu
2021-03-25  6:57 ` [PATCH v3 04/14] bfq: introduce bfq_ioprio_class to get ioprio class brookxu
2021-03-25  6:57 ` [PATCH v3 05/14] bfq: limit the IO depth of CLASS_IDLE to 1 brookxu
2021-03-25  6:57 ` [PATCH v3 06/14] bfq: keep the minimun bandwidth for CLASS_BE brookxu
2021-03-25  6:57 ` brookxu [this message]
2021-03-25  6:57 ` [PATCH v3 08/14] bfq: introduce prio_expire flag for bfq_queue brookxu
2021-03-25  6:57 ` [PATCH v3 09/14] bfq: expire in_serv_queue for prio_expire under better_fairness brookxu
2021-03-25  6:57 ` [PATCH v3 10/14] bfq: optimize IO injection " brookxu
2021-03-25  6:57 ` [PATCH v3 11/14] bfq: disable idle for prio_expire " brookxu
2021-03-25  6:57 ` [PATCH v3 12/14] bfq: disable merging between different groups " brookxu
2021-03-25  6:57 ` [PATCH v3 13/14] bfq: remove unnecessary initialization logic brookxu
2021-03-25  6:57 ` [PATCH v3 14/14] bfq: optimize the calculation of bfq_weight_to_ioprio() brookxu
2021-04-04 16:09 ` [PATCH v3 00/14] bfq: introduce bfq.ioprio for cgroup Tejun Heo
2021-04-06  7:31   ` 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=9d9566d30702268e1f270f0cf7e8b08444c127a6.1616649216.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: 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;
as well as URLs for NNTP newsgroup(s).