diff options
author | Vivek Goyal <vgoyal@redhat.com> | 2010-04-26 13:27:56 -0400 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2010-04-26 13:27:56 -0400 |
commit | afc24d49c1e5dbeef745c1c1246f5ae6ebd97c71 (patch) | |
tree | c936676ed21d032bf1d27f9ff1451f6242c8b3b6 /block | |
parent | e5ff082e8a68d9a6874990597497c7e6a96ad752 (diff) |
blk-cgroup: config options re-arrangement
This patch fixes few usability and configurability issues.
o All the cgroup based controller options are configurable from
"Genral Setup/Control Group Support/" menu. blkio is the only exception.
Hence make this option visible in above menu and make it configurable from
there to bring it inline with rest of the cgroup based controllers.
o Get rid of CONFIG_DEBUG_CFQ_IOSCHED.
This option currently does two things.
- Enable printing of cgroup paths in blktrace
- Enables CONFIG_DEBUG_BLK_CGROUP, which in turn displays additional stat
files in cgroup.
If we are using group scheduling, blktrace data is of not really much use
if cgroup information is not present. To get this data, currently one has to
also enable CONFIG_DEBUG_CFQ_IOSCHED, which in turn brings the overhead of
all the additional debug stat files which is not desired.
Hence, this patch moves printing of cgroup paths under
CONFIG_CFQ_GROUP_IOSCHED.
This allows us to get rid of CONFIG_DEBUG_CFQ_IOSCHED completely. Now all
the debug stat files are controlled only by CONFIG_DEBUG_BLK_CGROUP which
can be enabled through config menu.
Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Acked-by: Divyesh Shah <dpshah@google.com>
Reviewed-by: Gui Jianfeng <guijianfeng@cn.fujitsu.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'block')
-rw-r--r-- | block/Kconfig | 23 | ||||
-rw-r--r-- | block/Kconfig.iosched | 16 | ||||
-rw-r--r-- | block/blk-cgroup.c | 2 | ||||
-rw-r--r-- | block/blk-cgroup.h | 14 | ||||
-rw-r--r-- | block/cfq-iosched.c | 2 |
5 files changed, 13 insertions, 44 deletions
diff --git a/block/Kconfig b/block/Kconfig index f9e89f4d94bb..9be0b56eaee1 100644 --- a/block/Kconfig +++ b/block/Kconfig | |||
@@ -77,29 +77,6 @@ config BLK_DEV_INTEGRITY | |||
77 | T10/SCSI Data Integrity Field or the T13/ATA External Path | 77 | T10/SCSI Data Integrity Field or the T13/ATA External Path |
78 | Protection. If in doubt, say N. | 78 | Protection. If in doubt, say N. |
79 | 79 | ||
80 | config BLK_CGROUP | ||
81 | tristate "Block cgroup support" | ||
82 | depends on CGROUPS | ||
83 | depends on CFQ_GROUP_IOSCHED | ||
84 | default n | ||
85 | ---help--- | ||
86 | Generic block IO controller cgroup interface. This is the common | ||
87 | cgroup interface which should be used by various IO controlling | ||
88 | policies. | ||
89 | |||
90 | Currently, CFQ IO scheduler uses it to recognize task groups and | ||
91 | control disk bandwidth allocation (proportional time slice allocation) | ||
92 | to such task groups. | ||
93 | |||
94 | config DEBUG_BLK_CGROUP | ||
95 | bool | ||
96 | depends on BLK_CGROUP | ||
97 | default n | ||
98 | ---help--- | ||
99 | Enable some debugging help. Currently it stores the cgroup path | ||
100 | in the blk group which can be used by cfq for tracing various | ||
101 | group related activity. | ||
102 | |||
103 | endif # BLOCK | 80 | endif # BLOCK |
104 | 81 | ||
105 | config BLOCK_COMPAT | 82 | config BLOCK_COMPAT |
diff --git a/block/Kconfig.iosched b/block/Kconfig.iosched index fc71cf071fb2..3199b76f795d 100644 --- a/block/Kconfig.iosched +++ b/block/Kconfig.iosched | |||
@@ -23,7 +23,8 @@ config IOSCHED_DEADLINE | |||
23 | 23 | ||
24 | config IOSCHED_CFQ | 24 | config IOSCHED_CFQ |
25 | tristate "CFQ I/O scheduler" | 25 | tristate "CFQ I/O scheduler" |
26 | select BLK_CGROUP if CFQ_GROUP_IOSCHED | 26 | # If BLK_CGROUP is a module, CFQ has to be built as module. |
27 | depends on (BLK_CGROUP=m && m) || !BLK_CGROUP || BLK_CGROUP=y | ||
27 | default y | 28 | default y |
28 | ---help--- | 29 | ---help--- |
29 | The CFQ I/O scheduler tries to distribute bandwidth equally | 30 | The CFQ I/O scheduler tries to distribute bandwidth equally |
@@ -33,22 +34,15 @@ config IOSCHED_CFQ | |||
33 | 34 | ||
34 | This is the default I/O scheduler. | 35 | This is the default I/O scheduler. |
35 | 36 | ||
37 | Note: If BLK_CGROUP=m, then CFQ can be built only as module. | ||
38 | |||
36 | config CFQ_GROUP_IOSCHED | 39 | config CFQ_GROUP_IOSCHED |
37 | bool "CFQ Group Scheduling support" | 40 | bool "CFQ Group Scheduling support" |
38 | depends on IOSCHED_CFQ && CGROUPS | 41 | depends on IOSCHED_CFQ && BLK_CGROUP |
39 | default n | 42 | default n |
40 | ---help--- | 43 | ---help--- |
41 | Enable group IO scheduling in CFQ. | 44 | Enable group IO scheduling in CFQ. |
42 | 45 | ||
43 | config DEBUG_CFQ_IOSCHED | ||
44 | bool "Debug CFQ Scheduling" | ||
45 | depends on CFQ_GROUP_IOSCHED | ||
46 | select DEBUG_BLK_CGROUP | ||
47 | default n | ||
48 | ---help--- | ||
49 | Enable CFQ IO scheduling debugging in CFQ. Currently it makes | ||
50 | blktrace output more verbose. | ||
51 | |||
52 | choice | 46 | choice |
53 | prompt "Default I/O scheduler" | 47 | prompt "Default I/O scheduler" |
54 | default DEFAULT_CFQ | 48 | default DEFAULT_CFQ |
diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c index af42efbb0c1d..d02bbf88de13 100644 --- a/block/blk-cgroup.c +++ b/block/blk-cgroup.c | |||
@@ -351,10 +351,8 @@ void blkiocg_add_blkio_group(struct blkio_cgroup *blkcg, | |||
351 | blkg->blkcg_id = css_id(&blkcg->css); | 351 | blkg->blkcg_id = css_id(&blkcg->css); |
352 | hlist_add_head_rcu(&blkg->blkcg_node, &blkcg->blkg_list); | 352 | hlist_add_head_rcu(&blkg->blkcg_node, &blkcg->blkg_list); |
353 | spin_unlock_irqrestore(&blkcg->lock, flags); | 353 | spin_unlock_irqrestore(&blkcg->lock, flags); |
354 | #ifdef CONFIG_DEBUG_BLK_CGROUP | ||
355 | /* Need to take css reference ? */ | 354 | /* Need to take css reference ? */ |
356 | cgroup_path(blkcg->css.cgroup, blkg->path, sizeof(blkg->path)); | 355 | cgroup_path(blkcg->css.cgroup, blkg->path, sizeof(blkg->path)); |
357 | #endif | ||
358 | blkg->dev = dev; | 356 | blkg->dev = dev; |
359 | } | 357 | } |
360 | EXPORT_SYMBOL_GPL(blkiocg_add_blkio_group); | 358 | EXPORT_SYMBOL_GPL(blkiocg_add_blkio_group); |
diff --git a/block/blk-cgroup.h b/block/blk-cgroup.h index a491a6d56ecf..2b866ec1dcea 100644 --- a/block/blk-cgroup.h +++ b/block/blk-cgroup.h | |||
@@ -108,10 +108,8 @@ struct blkio_group { | |||
108 | void *key; | 108 | void *key; |
109 | struct hlist_node blkcg_node; | 109 | struct hlist_node blkcg_node; |
110 | unsigned short blkcg_id; | 110 | unsigned short blkcg_id; |
111 | #ifdef CONFIG_DEBUG_BLK_CGROUP | ||
112 | /* Store cgroup path */ | 111 | /* Store cgroup path */ |
113 | char path[128]; | 112 | char path[128]; |
114 | #endif | ||
115 | /* The device MKDEV(major, minor), this group has been created for */ | 113 | /* The device MKDEV(major, minor), this group has been created for */ |
116 | dev_t dev; | 114 | dev_t dev; |
117 | 115 | ||
@@ -147,6 +145,11 @@ struct blkio_policy_type { | |||
147 | extern void blkio_policy_register(struct blkio_policy_type *); | 145 | extern void blkio_policy_register(struct blkio_policy_type *); |
148 | extern void blkio_policy_unregister(struct blkio_policy_type *); | 146 | extern void blkio_policy_unregister(struct blkio_policy_type *); |
149 | 147 | ||
148 | static inline char *blkg_path(struct blkio_group *blkg) | ||
149 | { | ||
150 | return blkg->path; | ||
151 | } | ||
152 | |||
150 | #else | 153 | #else |
151 | 154 | ||
152 | struct blkio_group { | 155 | struct blkio_group { |
@@ -158,6 +161,8 @@ struct blkio_policy_type { | |||
158 | static inline void blkio_policy_register(struct blkio_policy_type *blkiop) { } | 161 | static inline void blkio_policy_register(struct blkio_policy_type *blkiop) { } |
159 | static inline void blkio_policy_unregister(struct blkio_policy_type *blkiop) { } | 162 | static inline void blkio_policy_unregister(struct blkio_policy_type *blkiop) { } |
160 | 163 | ||
164 | static inline char *blkg_path(struct blkio_group *blkg) { return NULL; } | ||
165 | |||
161 | #endif | 166 | #endif |
162 | 167 | ||
163 | #define BLKIO_WEIGHT_MIN 100 | 168 | #define BLKIO_WEIGHT_MIN 100 |
@@ -165,10 +170,6 @@ static inline void blkio_policy_unregister(struct blkio_policy_type *blkiop) { } | |||
165 | #define BLKIO_WEIGHT_DEFAULT 500 | 170 | #define BLKIO_WEIGHT_DEFAULT 500 |
166 | 171 | ||
167 | #ifdef CONFIG_DEBUG_BLK_CGROUP | 172 | #ifdef CONFIG_DEBUG_BLK_CGROUP |
168 | static inline char *blkg_path(struct blkio_group *blkg) | ||
169 | { | ||
170 | return blkg->path; | ||
171 | } | ||
172 | void blkiocg_update_avg_queue_size_stats(struct blkio_group *blkg); | 173 | void blkiocg_update_avg_queue_size_stats(struct blkio_group *blkg); |
173 | void blkiocg_update_dequeue_stats(struct blkio_group *blkg, | 174 | void blkiocg_update_dequeue_stats(struct blkio_group *blkg, |
174 | unsigned long dequeue); | 175 | unsigned long dequeue); |
@@ -197,7 +198,6 @@ BLKG_FLAG_FNS(idling) | |||
197 | BLKG_FLAG_FNS(empty) | 198 | BLKG_FLAG_FNS(empty) |
198 | #undef BLKG_FLAG_FNS | 199 | #undef BLKG_FLAG_FNS |
199 | #else | 200 | #else |
200 | static inline char *blkg_path(struct blkio_group *blkg) { return NULL; } | ||
201 | static inline void blkiocg_update_avg_queue_size_stats( | 201 | static inline void blkiocg_update_avg_queue_size_stats( |
202 | struct blkio_group *blkg) {} | 202 | struct blkio_group *blkg) {} |
203 | static inline void blkiocg_update_dequeue_stats(struct blkio_group *blkg, | 203 | static inline void blkiocg_update_dequeue_stats(struct blkio_group *blkg, |
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c index 002a5b621653..286008cf889e 100644 --- a/block/cfq-iosched.c +++ b/block/cfq-iosched.c | |||
@@ -345,7 +345,7 @@ CFQ_CFQQ_FNS(deep); | |||
345 | CFQ_CFQQ_FNS(wait_busy); | 345 | CFQ_CFQQ_FNS(wait_busy); |
346 | #undef CFQ_CFQQ_FNS | 346 | #undef CFQ_CFQQ_FNS |
347 | 347 | ||
348 | #ifdef CONFIG_DEBUG_CFQ_IOSCHED | 348 | #ifdef CONFIG_CFQ_GROUP_IOSCHED |
349 | #define cfq_log_cfqq(cfqd, cfqq, fmt, args...) \ | 349 | #define cfq_log_cfqq(cfqd, cfqq, fmt, args...) \ |
350 | blk_add_trace_msg((cfqd)->queue, "cfq%d%c %s " fmt, (cfqq)->pid, \ | 350 | blk_add_trace_msg((cfqd)->queue, "cfq%d%c %s " fmt, (cfqq)->pid, \ |
351 | cfq_cfqq_sync((cfqq)) ? 'S' : 'A', \ | 351 | cfq_cfqq_sync((cfqq)) ? 'S' : 'A', \ |