diff options
author | Tejun Heo <tj@kernel.org> | 2012-04-19 19:29:24 -0400 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2012-04-20 04:06:40 -0400 |
commit | a637120e49021d197e9578cba545bbaa459cbb51 (patch) | |
tree | 0d502a8fcc55c89eb4d79a7578e46a9273d1f2c8 /block/blk-cgroup.h | |
parent | 496fb7806d616185a46865a4f3a20ef19dc6c7e3 (diff) |
blkcg: use radix tree to index blkgs from blkcg
blkg lookup is currently performed by traversing linked list anchored
at blkcg->blkg_list. This is very unscalable and with blk-throttle
enabled and enough request queues on the system, this can get very
ugly quickly (blk-throttle performs look up on every bio submission).
This patch makes blkcg use radix tree to index blkgs combined with
simple last-looked-up hint. This is mostly identical to how icqs are
indexed from ioc.
Note that because __blkg_lookup() may be invoked without holding queue
lock, hint is only updated from __blkg_lookup_create(). Due to cfq's
cfqq caching, this makes hint updates overly lazy. This will be
improved with scheduled blkcg aware request allocation.
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk-cgroup.h')
-rw-r--r-- | block/blk-cgroup.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/block/blk-cgroup.h b/block/blk-cgroup.h index 44cb9086ed42..8ac457ce7783 100644 --- a/block/blk-cgroup.h +++ b/block/blk-cgroup.h | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/cgroup.h> | 16 | #include <linux/cgroup.h> |
17 | #include <linux/u64_stats_sync.h> | 17 | #include <linux/u64_stats_sync.h> |
18 | #include <linux/seq_file.h> | 18 | #include <linux/seq_file.h> |
19 | #include <linux/radix-tree.h> | ||
19 | 20 | ||
20 | /* Max limits for throttle policy */ | 21 | /* Max limits for throttle policy */ |
21 | #define THROTL_IOPS_MAX UINT_MAX | 22 | #define THROTL_IOPS_MAX UINT_MAX |
@@ -37,9 +38,14 @@ enum blkg_rwstat_type { | |||
37 | BLKG_RWSTAT_TOTAL = BLKG_RWSTAT_NR, | 38 | BLKG_RWSTAT_TOTAL = BLKG_RWSTAT_NR, |
38 | }; | 39 | }; |
39 | 40 | ||
41 | struct blkcg_gq; | ||
42 | |||
40 | struct blkcg { | 43 | struct blkcg { |
41 | struct cgroup_subsys_state css; | 44 | struct cgroup_subsys_state css; |
42 | spinlock_t lock; | 45 | spinlock_t lock; |
46 | |||
47 | struct radix_tree_root blkg_tree; | ||
48 | struct blkcg_gq *blkg_hint; | ||
43 | struct hlist_head blkg_list; | 49 | struct hlist_head blkg_list; |
44 | 50 | ||
45 | /* for policies to test whether associated blkcg has changed */ | 51 | /* for policies to test whether associated blkcg has changed */ |