aboutsummaryrefslogtreecommitdiffstats
path: root/block/blk-cgroup.h
diff options
context:
space:
mode:
authorVivek Goyal <vgoyal@redhat.com>2009-12-04 10:36:42 -0500
committerJens Axboe <jens.axboe@oracle.com>2009-12-04 10:38:14 -0500
commit3e2520668970aab5a764044a298e987aafc1f63d (patch)
tree088ebf7c4576d597774c8c332bab590dc3a472d6 /block/blk-cgroup.h
parent9d6a986c0b276085f7944cd8ad65f4f82aff7536 (diff)
blkio: Implement dynamic io controlling policy registration
o One of the goals of block IO controller is that it should be able to support mulitple io control policies, some of which be operational at higher level in storage hierarchy. o To begin with, we had one io controlling policy implemented by CFQ, and I hard coded the CFQ functions called by blkio. This created issues when CFQ is compiled as module. o This patch implements a basic dynamic io controlling policy registration functionality in blkio. This is similar to elevator functionality where ioschedulers register the functions dynamically. o Now in future, when more IO controlling policies are implemented, these can dynakically register with block IO controller. Signed-off-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.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/block/blk-cgroup.h b/block/blk-cgroup.h
index 4f89b967467f..4d316df863b4 100644
--- a/block/blk-cgroup.h
+++ b/block/blk-cgroup.h
@@ -46,11 +46,35 @@ struct blkio_group {
46extern bool blkiocg_css_tryget(struct blkio_cgroup *blkcg); 46extern bool blkiocg_css_tryget(struct blkio_cgroup *blkcg);
47extern void blkiocg_css_put(struct blkio_cgroup *blkcg); 47extern void blkiocg_css_put(struct blkio_cgroup *blkcg);
48 48
49typedef void (blkio_unlink_group_fn) (void *key, struct blkio_group *blkg);
50typedef void (blkio_update_group_weight_fn) (struct blkio_group *blkg,
51 unsigned int weight);
52
53struct blkio_policy_ops {
54 blkio_unlink_group_fn *blkio_unlink_group_fn;
55 blkio_update_group_weight_fn *blkio_update_group_weight_fn;
56};
57
58struct blkio_policy_type {
59 struct list_head list;
60 struct blkio_policy_ops ops;
61};
62
63/* Blkio controller policy registration */
64extern void blkio_policy_register(struct blkio_policy_type *);
65extern void blkio_policy_unregister(struct blkio_policy_type *);
66
49#else 67#else
50 68
51struct blkio_group { 69struct blkio_group {
52}; 70};
53 71
72struct blkio_policy_type {
73};
74
75static inline void blkio_policy_register(struct blkio_policy_type *blkiop) { }
76static inline void blkio_policy_unregister(struct blkio_policy_type *blkiop) { }
77
54#endif 78#endif
55 79
56#define BLKIO_WEIGHT_MIN 100 80#define BLKIO_WEIGHT_MIN 100