linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: axboe@kernel.dk, hannes@cmpxchg.org, lizefan@huawei.com
Cc: linux-kernel@vger.kernel.org, vgoyal@redhat.com,
	avanzini.arianna@gmail.com, cgroups@vger.kernel.org,
	kernel-team@fb.com, Tejun Heo <tj@kernel.org>
Subject: [PATCH 3/4] blkcg: s/CFQ_WEIGHT_*/CFQ_WEIGHT_LEGACY_*/
Date: Sun,  2 Aug 2015 16:23:43 -0400	[thread overview]
Message-ID: <1438547024-23497-4-git-send-email-tj@kernel.org> (raw)
In-Reply-To: <1438547024-23497-1-git-send-email-tj@kernel.org>

blkcg is gonna switch to cgroup common weight range as defined by
CGROUP_WEIGHT_* on the unified hierarchy.  In preparation, rename
CFQ_WEIGHT_* constants to CFQ_WEIGHT_LEGACY_*.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Vivek Goyal <vgoyal@redhat.com>
Cc: Arianna Avanzini <avanzini.arianna@gmail.com>
---
 block/cfq-iosched.c | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
index 97da571..0fe721e 100644
--- a/block/cfq-iosched.c
+++ b/block/cfq-iosched.c
@@ -68,9 +68,9 @@ static struct kmem_cache *cfq_pool;
 #define rb_entry_cfqg(node)	rb_entry((node), struct cfq_group, rb_node)
 
 /* blkio-related constants */
-#define CFQ_WEIGHT_MIN          10
-#define CFQ_WEIGHT_MAX          1000
-#define CFQ_WEIGHT_DEFAULT      500
+#define CFQ_WEIGHT_LEGACY_MIN	10
+#define CFQ_WEIGHT_LEGACY_DFL	500
+#define CFQ_WEIGHT_LEGACY_MAX	1000
 
 struct cfq_ttime {
 	unsigned long last_end_request;
@@ -1580,11 +1580,11 @@ static void cfq_cpd_init(struct blkcg_policy_data *cpd)
 	struct cfq_group_data *cgd = cpd_to_cfqgd(cpd);
 
 	if (cpd_to_blkcg(cpd) == &blkcg_root) {
-		cgd->weight = 2 * CFQ_WEIGHT_DEFAULT;
-		cgd->leaf_weight = 2 * CFQ_WEIGHT_DEFAULT;
+		cgd->weight = 2 * CFQ_WEIGHT_LEGACY_DFL;
+		cgd->leaf_weight = 2 * CFQ_WEIGHT_LEGACY_DFL;
 	} else {
-		cgd->weight = CFQ_WEIGHT_DEFAULT;
-		cgd->leaf_weight = CFQ_WEIGHT_DEFAULT;
+		cgd->weight = CFQ_WEIGHT_LEGACY_DFL;
+		cgd->leaf_weight = CFQ_WEIGHT_LEGACY_DFL;
 	}
 }
 
@@ -1769,7 +1769,7 @@ static ssize_t __cfqg_set_weight_device(struct kernfs_open_file *of,
 	cfqgd = blkcg_to_cfqgd(blkcg);
 
 	ret = -ERANGE;
-	if (!v || (v >= CFQ_WEIGHT_MIN && v <= CFQ_WEIGHT_MAX)) {
+	if (!v || (v >= CFQ_WEIGHT_LEGACY_MIN && v <= CFQ_WEIGHT_LEGACY_MAX)) {
 		if (!is_leaf_weight) {
 			cfqg->dev_weight = v;
 			cfqg->new_weight = v ?: cfqgd->weight;
@@ -1804,7 +1804,7 @@ static int __cfq_set_weight(struct cgroup_subsys_state *css, u64 val,
 	struct cfq_group_data *cfqgd;
 	int ret = 0;
 
-	if (val < CFQ_WEIGHT_MIN || val > CFQ_WEIGHT_MAX)
+	if (val < CFQ_WEIGHT_LEGACY_MIN || val > CFQ_WEIGHT_LEGACY_MAX)
 		return -EINVAL;
 
 	spin_lock_irq(&blkcg->lock);
@@ -4513,8 +4513,8 @@ static int cfq_init_queue(struct request_queue *q, struct elevator_type *e)
 
 	cfq_init_cfqg_base(cfqd->root_group);
 #endif
-	cfqd->root_group->weight = 2 * CFQ_WEIGHT_DEFAULT;
-	cfqd->root_group->leaf_weight = 2 * CFQ_WEIGHT_DEFAULT;
+	cfqd->root_group->weight = 2 * CFQ_WEIGHT_LEGACY_DFL;
+	cfqd->root_group->leaf_weight = 2 * CFQ_WEIGHT_LEGACY_DFL;
 
 	/*
 	 * Not strictly needed (since RB_ROOT just clears the node and we
-- 
2.4.3


  parent reply	other threads:[~2015-08-02 20:24 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-02 20:23 [PATCHSET cgroup,block/for-4.3] cgroup, blkcg: establish controller interface conventions Tejun Heo
2015-08-02 20:23 ` [PATCH 1/4] cgroup: export cgrp_dfl_root Tejun Heo
2015-08-05  8:18   ` Zefan Li
2015-08-05 20:23   ` Tejun Heo
2015-08-02 20:23 ` [PATCH 2/4] cgroup: define controller file conventions Tejun Heo
2015-08-03 13:36   ` Johannes Weiner
2015-08-05  8:19   ` Zefan Li
2015-08-02 20:23 ` Tejun Heo [this message]
2015-08-02 20:23 ` [PATCH 4/4] blkcg: use CGROUP_WEIGHT_* scale for io.weight on the unified hierarchy Tejun Heo

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=1438547024-23497-4-git-send-email-tj@kernel.org \
    --to=tj@kernel.org \
    --cc=avanzini.arianna@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=cgroups@vger.kernel.org \
    --cc=hannes@cmpxchg.org \
    --cc=kernel-team@fb.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizefan@huawei.com \
    --cc=vgoyal@redhat.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;
as well as URLs for NNTP newsgroup(s).