diff options
author | Tejun Heo <tj@kernel.org> | 2012-03-05 16:15:07 -0500 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2012-03-06 15:27:22 -0500 |
commit | e56da7e287967667474a58c4f60c286279e3f487 (patch) | |
tree | 4ce64581888f287a25b4abdc21fc641210351612 /block/blk-cgroup.h | |
parent | cd1604fab4f95f7cfc227d3955fd7ae14da61f38 (diff) |
blkcg: don't allow or retain configuration of missing devices
blkcg is very peculiar in that it allows setting and remembering
configurations for non-existent devices by maintaining separate data
structures for configuration.
This behavior is completely out of the usual norms and outright
confusing; furthermore, it uses dev_t number to match the
configuration to devices, which is unpredictable to begin with and
becomes completely unuseable if EXT_DEVT is fully used.
It is wholely unnecessary - we already have fully functional userland
mechanism to program devices being hotplugged which has full access to
device identification, connection topology and filesystem information.
Add a new struct blkio_group_conf which contains all blkcg
configurations to blkio_group and let blkio_group, which can be
created iff the associated device exists and is removed when the
associated device goes away, carry all configurations.
Note that, after this patch, all newly created blkg's will always have
the default configuration (unlimited for throttling and blkcg's weight
for propio).
This patch makes blkio_policy_node meaningless but doesn't remove it.
The next patch will.
-v2: Updated to retry after short sleep if blkg lookup/creation failed
due to the queue being temporarily bypassed as indicated by
-EBUSY return. Pointed out by Vivek.
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Vivek Goyal <vgoyal@redhat.com>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk-cgroup.h')
-rw-r--r-- | block/blk-cgroup.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/block/blk-cgroup.h b/block/blk-cgroup.h index 2600ae7e6f60..81efe718a1c6 100644 --- a/block/blk-cgroup.h +++ b/block/blk-cgroup.h | |||
@@ -154,6 +154,12 @@ struct blkio_group_stats_cpu { | |||
154 | struct u64_stats_sync syncp; | 154 | struct u64_stats_sync syncp; |
155 | }; | 155 | }; |
156 | 156 | ||
157 | struct blkio_group_conf { | ||
158 | unsigned int weight; | ||
159 | unsigned int iops[2]; | ||
160 | u64 bps[2]; | ||
161 | }; | ||
162 | |||
157 | struct blkio_group { | 163 | struct blkio_group { |
158 | /* Pointer to the associated request_queue, RCU protected */ | 164 | /* Pointer to the associated request_queue, RCU protected */ |
159 | struct request_queue __rcu *q; | 165 | struct request_queue __rcu *q; |
@@ -166,6 +172,9 @@ struct blkio_group { | |||
166 | /* policy which owns this blk group */ | 172 | /* policy which owns this blk group */ |
167 | enum blkio_policy_id plid; | 173 | enum blkio_policy_id plid; |
168 | 174 | ||
175 | /* Configuration */ | ||
176 | struct blkio_group_conf conf; | ||
177 | |||
169 | /* Need to serialize the stats in the case of reset/update */ | 178 | /* Need to serialize the stats in the case of reset/update */ |
170 | spinlock_t stats_lock; | 179 | spinlock_t stats_lock; |
171 | struct blkio_group_stats stats; | 180 | struct blkio_group_stats stats; |