From: Gui Jianfeng <guijianfeng@cn.fujitsu.com>
To: Vivek Goyal <vgoyal@redhat.com>, Jens Axboe <axboe@kernel.dk>
Cc: linux kernel mailing list <linux-kernel@vger.kernel.org>,
Corrado Zoccolo <czoccolo@gmail.com>,
Chad Talbott <ctalbott@google.com>,
Nauman Rafique <nauman@google.com>,
Divyesh Shah <dpshah@google.com>,
Gui Jianfeng <guijianfeng@cn.fujitsu.com>
Subject: [RFC] [PATCH 6/8] cfq-iosched: Get rid of on_st flag
Date: Mon, 15 Nov 2010 08:57:31 +0800 [thread overview]
Message-ID: <4CE0857B.20705@cn.fujitsu.com> (raw)
It's able to check whether a CFQ group on a service tree by
checking "entity->rb_node". There's no need to maintain an
extra flag here.
Signed-off-by: Gui Jianfeng <guijianfeng@cn.fujitsu.com>
---
block/cfq-iosched.c | 9 +--------
1 files changed, 1 insertions(+), 8 deletions(-)
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
index 1b9b4b2..1df0928 100644
--- a/block/cfq-iosched.c
+++ b/block/cfq-iosched.c
@@ -103,7 +103,6 @@ struct io_sched_entity {
struct rb_node rb_node;
/* service_tree key */
u64 vdisktime;
- bool on_st;
bool is_group_entity;
unsigned int weight;
};
@@ -890,8 +889,6 @@ io_entity_service_tree_add(struct cfq_rb_root *st,
__io_entity_service_tree_add(st, io_entity);
st->count++;
st->total_weight += io_entity->weight;
- if (io_entity->is_group_entity)
- io_entity->on_st = true;
}
static void
@@ -903,7 +900,7 @@ cfq_group_service_tree_add(struct cfq_data *cfqd, struct cfq_group *cfqg)
struct io_sched_entity *__group_entity;
cfqg->nr_cfqq++;
- if (group_entity->on_st)
+ if (!RB_EMPTY_NODE(&group_entity->rb_node))
return;
/*
@@ -936,8 +933,6 @@ io_entity_service_tree_del(struct cfq_rb_root *st,
if (!RB_EMPTY_NODE(&io_entity->rb_node)) {
__io_entity_service_tree_del(st, io_entity);
st->total_weight -= io_entity->weight;
- if (io_entity->is_group_entity)
- io_entity->on_st = false;
io_entity->service_tree = NULL;
}
}
@@ -1070,7 +1065,6 @@ cfq_find_alloc_cfqg(struct cfq_data *cfqd, struct cgroup *cgroup, int create)
RB_CLEAR_NODE(&cfqg->group_entity.rb_node);
cfqg->group_entity.is_group_entity = true;
- cfqg->group_entity.on_st = false;
/*
* Take the initial reference that will be released on destroy
@@ -3972,7 +3966,6 @@ static void *cfq_init_queue(struct request_queue *q)
/* Give preference to root group over other groups */
cfqg->group_entity.weight = 2*BLKIO_WEIGHT_DEFAULT;
cfqg->group_entity.is_group_entity = true;
- cfqg->group_entity.on_st = false;
#ifdef CONFIG_CFQ_GROUP_IOSCHED
/*
--
1.6.5.2
reply other threads:[~2010-11-15 0:57 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=4CE0857B.20705@cn.fujitsu.com \
--to=guijianfeng@cn.fujitsu.com \
--cc=axboe@kernel.dk \
--cc=ctalbott@google.com \
--cc=czoccolo@gmail.com \
--cc=dpshah@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=nauman@google.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