aboutsummaryrefslogtreecommitdiffstats
path: root/block/blk-cgroup.h
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2012-04-01 17:38:44 -0400
committerTejun Heo <tj@kernel.org>2012-04-01 17:38:44 -0400
commit3381cb8d2ef1523dbaeec99161d766c25f1e52d6 (patch)
treeb5592ee2a0f84e694282c947611971eb7735622d /block/blk-cgroup.h
parent8a3d26151f24e2a2ffa550890144c3d54d2edb15 (diff)
blkcg: move blkio_group_conf->weight to cfq
blkio_group_conf->weight is owned by cfq and has no reason to be defined in blkcg core. Replace it with cfq_group->dev_weight and let conf setting functions directly set it. If dev_weight is zero, the cfqg doesn't have device specific weight configured. Also, rename BLKIO_WEIGHT_* constants to CFQ_WEIGHT_* and rename blkio_cgroup->weight to blkio_cgroup->cfq_weight. We eventually want per-policy storage in blkio_cgroup but just mark the ownership of the field for now. Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'block/blk-cgroup.h')
-rw-r--r--block/blk-cgroup.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/block/blk-cgroup.h b/block/blk-cgroup.h
index e368dd00b8cf..386db2974a08 100644
--- a/block/blk-cgroup.h
+++ b/block/blk-cgroup.h
@@ -29,6 +29,11 @@ enum blkio_policy_id {
29 29
30#ifdef CONFIG_BLK_CGROUP 30#ifdef CONFIG_BLK_CGROUP
31 31
32/* CFQ specific, out here for blkcg->cfq_weight */
33#define CFQ_WEIGHT_MIN 10
34#define CFQ_WEIGHT_MAX 1000
35#define CFQ_WEIGHT_DEFAULT 500
36
32/* cft->private [un]packing for stat printing */ 37/* cft->private [un]packing for stat printing */
33#define BLKCG_STAT_PRIV(pol, off) (((unsigned)(pol) << 16) | (off)) 38#define BLKCG_STAT_PRIV(pol, off) (((unsigned)(pol) << 16) | (off))
34#define BLKCG_STAT_POL(prv) ((unsigned)(prv) >> 16) 39#define BLKCG_STAT_POL(prv) ((unsigned)(prv) >> 16)
@@ -46,12 +51,14 @@ enum blkg_rwstat_type {
46 51
47struct blkio_cgroup { 52struct blkio_cgroup {
48 struct cgroup_subsys_state css; 53 struct cgroup_subsys_state css;
49 unsigned int weight;
50 spinlock_t lock; 54 spinlock_t lock;
51 struct hlist_head blkg_list; 55 struct hlist_head blkg_list;
52 56
53 /* for policies to test whether associated blkcg has changed */ 57 /* for policies to test whether associated blkcg has changed */
54 uint64_t id; 58 uint64_t id;
59
60 /* TODO: per-policy storage in blkio_cgroup */
61 unsigned int cfq_weight; /* belongs to cfq */
55}; 62};
56 63
57struct blkg_stat { 64struct blkg_stat {
@@ -65,7 +72,6 @@ struct blkg_rwstat {
65}; 72};
66 73
67struct blkio_group_conf { 74struct blkio_group_conf {
68 unsigned int weight;
69 u64 iops[2]; 75 u64 iops[2];
70 u64 bps[2]; 76 u64 bps[2];
71}; 77};
@@ -355,10 +361,6 @@ static inline void blkg_put(struct blkio_group *blkg) { }
355 361
356#endif 362#endif
357 363
358#define BLKIO_WEIGHT_MIN 10
359#define BLKIO_WEIGHT_MAX 1000
360#define BLKIO_WEIGHT_DEFAULT 500
361
362#ifdef CONFIG_BLK_CGROUP 364#ifdef CONFIG_BLK_CGROUP
363extern struct blkio_cgroup blkio_root_cgroup; 365extern struct blkio_cgroup blkio_root_cgroup;
364extern struct blkio_cgroup *cgroup_to_blkio_cgroup(struct cgroup *cgroup); 366extern struct blkio_cgroup *cgroup_to_blkio_cgroup(struct cgroup *cgroup);