diff options
author | Gui Jianfeng <guijianfeng@cn.fujitsu.com> | 2010-04-13 04:05:49 -0400 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2010-04-13 04:14:20 -0400 |
commit | 34d0f179d6dd711d3fc13c0820a456c59aae8048 (patch) | |
tree | 0e3d533e16cd7d99b0d28ec13353862f1da96dfd /block/blk-cgroup.h | |
parent | 812df48d127365ffd0869aa139738f572a86759c (diff) |
io-controller: Add a new interface "weight_device" for IO-Controller
Currently, IO Controller makes use of blkio.weight to assign weight for
all devices. Here a new user interface "blkio.weight_device" is introduced to
assign different weights for different devices. blkio.weight becomes the
default value for devices which are not configured by "blkio.weight_device"
You can use the following format to assigned specific weight for a given
device:
#echo "major:minor weight" > blkio.weight_device
major:minor represents device number.
And you can remove weight for a given device as following:
#echo "major:minor 0" > blkio.weight_device
V1->V2 changes:
- use user interface "weight_device" instead of "policy" suggested by Vivek
- rename some struct suggested by Vivek
- rebase to 2.6-block "for-linus" branch
- remove an useless list_empty check pointed out by Li Zefan
- some trivial typo fix
V2->V3 changes:
- Move policy_*_node() functions up to get rid of forward declarations
- rename related functions by adding prefix "blkio_"
Signed-off-by: Gui Jianfeng <guijianfeng@cn.fujitsu.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'block/blk-cgroup.h')
-rw-r--r-- | block/blk-cgroup.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/block/blk-cgroup.h b/block/blk-cgroup.h index bfce085b1962..3c27bdfc97b9 100644 --- a/block/blk-cgroup.h +++ b/block/blk-cgroup.h | |||
@@ -70,6 +70,7 @@ struct blkio_cgroup { | |||
70 | unsigned int weight; | 70 | unsigned int weight; |
71 | spinlock_t lock; | 71 | spinlock_t lock; |
72 | struct hlist_head blkg_list; | 72 | struct hlist_head blkg_list; |
73 | struct list_head policy_list; /* list of blkio_policy_node */ | ||
73 | }; | 74 | }; |
74 | 75 | ||
75 | struct blkio_group_stats { | 76 | struct blkio_group_stats { |
@@ -119,6 +120,15 @@ struct blkio_group { | |||
119 | struct blkio_group_stats stats; | 120 | struct blkio_group_stats stats; |
120 | }; | 121 | }; |
121 | 122 | ||
123 | struct blkio_policy_node { | ||
124 | struct list_head node; | ||
125 | dev_t dev; | ||
126 | unsigned int weight; | ||
127 | }; | ||
128 | |||
129 | extern unsigned int blkcg_get_weight(struct blkio_cgroup *blkcg, | ||
130 | dev_t dev); | ||
131 | |||
122 | typedef void (blkio_unlink_group_fn) (void *key, struct blkio_group *blkg); | 132 | typedef void (blkio_unlink_group_fn) (void *key, struct blkio_group *blkg); |
123 | typedef void (blkio_update_group_weight_fn) (struct blkio_group *blkg, | 133 | typedef void (blkio_update_group_weight_fn) (struct blkio_group *blkg, |
124 | unsigned int weight); | 134 | unsigned int weight); |