summaryrefslogtreecommitdiff
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 16:38:14 +0100
commit3e2520668970aab5a764044a298e987aafc1f63d (patch)
tree088ebf7c4576d597774c8c332bab590dc3a472d6 /block/blk-cgroup.h
parent9d6a986c0b276085f7944cd8ad65f4f82aff7536 (diff)
downloadlinux-3.10-3e2520668970aab5a764044a298e987aafc1f63d.tar.gz
linux-3.10-3e2520668970aab5a764044a298e987aafc1f63d.tar.bz2
linux-3.10-3e2520668970aab5a764044a298e987aafc1f63d.zip
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 4f89b967467..4d316df863b 100644
--- a/block/blk-cgroup.h
+++ b/block/blk-cgroup.h
@@ -46,11 +46,35 @@ struct blkio_group {
extern bool blkiocg_css_tryget(struct blkio_cgroup *blkcg);
extern void blkiocg_css_put(struct blkio_cgroup *blkcg);
+typedef void (blkio_unlink_group_fn) (void *key, struct blkio_group *blkg);
+typedef void (blkio_update_group_weight_fn) (struct blkio_group *blkg,
+ unsigned int weight);
+
+struct blkio_policy_ops {
+ blkio_unlink_group_fn *blkio_unlink_group_fn;
+ blkio_update_group_weight_fn *blkio_update_group_weight_fn;
+};
+
+struct blkio_policy_type {
+ struct list_head list;
+ struct blkio_policy_ops ops;
+};
+
+/* Blkio controller policy registration */
+extern void blkio_policy_register(struct blkio_policy_type *);
+extern void blkio_policy_unregister(struct blkio_policy_type *);
+
#else
struct blkio_group {
};
+struct blkio_policy_type {
+};
+
+static inline void blkio_policy_register(struct blkio_policy_type *blkiop) { }
+static inline void blkio_policy_unregister(struct blkio_policy_type *blkiop) { }
+
#endif
#define BLKIO_WEIGHT_MIN 100