History

blkcg: rename subsystem name from blkio to io

blkio interface has become messy over time and is currently the largest. In addition to the inconsistent naming scheme, it has multiple stat files which report more or less the same thing, a number of debug stat files which expose internal details which shouldn't have been part of the public interface in the first place, recursive and non-recursive stats and leaf and non-leaf knobs. Both recursive vs. non-recursive and leaf vs. non-leaf distinctions don't make any sense on the unified hierarchy as only leaf cgroups can contain processes. cgroups is going through a major interface revision with the unified hierarchy involving significant fundamental usage changes and given that a significant portion of the interface doesn't make sense anymore, it's a good time to reorganize the interface. As the first step, this patch renames the external visible subsystem name from "blkio" to "io". This is more concise, matches the other two major subsystem names, "cpu" and "memory", and better suited as blkcg will be involved in anything writeback related too whether an actual block device is involved or not. As the subsystem legacy_name is set to "blkio", the only userland visible change outside the unified hierarchy is that blkcg is reported as "io" instead of "blkio" in the subsystem initialized message during boot. On the unified hierarchy, blkcg now appears as "io".

Tejun Heo committed 11 years ago

Commit c165b3e1 parent 20386ce6 files · +11 −10Browse files

Unified · Split

6 files
  1. block/bio.c +1 −1
  2. block/blk-cgroup.c +4 −3
  3. include/linux/backing-dev.h +1 −1
  4. include/linux/blk-cgroup.h +2 −2
  5. include/linux/cgroup_subsys.h +1 −1
  6. mm/backing-dev.c +2 −2
block/bio.c+1−1
@@ -2046,7 +2046,7 @@ int bio_associate_current(struct bio *bio) · 2045 unmodified lines
2046 2046
2047 get_io_context_active(ioc);2047 get_io_context_active(ioc);
2048 bio->bi_ioc = ioc;2048 bio->bi_ioc = ioc;
2049 bio->bi_css = task_get_css(current, blkio_cgrp_id);2049 bio->bi_css = task_get_css(current, io_cgrp_id);
2050 return 0;2050 return 0;
2051}2051}
2052EXPORT_SYMBOL_GPL(bio_associate_current);2052EXPORT_SYMBOL_GPL(bio_associate_current);
block/blk-cgroup.c+4−3
@@ -1089,12 +1089,13 @@ static int blkcg_can_attach(struct cgroup_subsys_state *css, · 1088 unmodified lines
1089 return ret;1089 return ret;
1090}1090}
1091 1091
1092struct cgroup_subsys blkio_cgrp_subsys = {1092struct cgroup_subsys io_cgrp_subsys = {
1093 .css_alloc = blkcg_css_alloc,1093 .css_alloc = blkcg_css_alloc,
1094 .css_offline = blkcg_css_offline,1094 .css_offline = blkcg_css_offline,
1095 .css_free = blkcg_css_free,1095 .css_free = blkcg_css_free,
1096 .can_attach = blkcg_can_attach,1096 .can_attach = blkcg_can_attach,
1097 .legacy_cftypes = blkcg_files,1097 .legacy_cftypes = blkcg_files,
1098 .legacy_name = "blkio",
1098#ifdef CONFIG_MEMCG1099#ifdef CONFIG_MEMCG
1099 /*1100 /*
1100 * This ensures that, if available, memcg is automatically enabled1101 * This ensures that, if available, memcg is automatically enabled
@@ -1104,7 +1105,7 @@ struct cgroup_subsys blkio_cgrp_subsys = { · 3 unmodified lines
1104 .depends_on = 1 << memory_cgrp_id,1105 .depends_on = 1 << memory_cgrp_id,
1105#endif1106#endif
1106};1107};
1107EXPORT_SYMBOL_GPL(blkio_cgrp_subsys);1108EXPORT_SYMBOL_GPL(io_cgrp_subsys);
1108 1109
1109/**1110/**
1110 * blkcg_activate_policy - activate a blkcg policy on a request_queue1111 * blkcg_activate_policy - activate a blkcg policy on a request_queue
@@ -1266,7 +1267,7 @@ int blkcg_policy_register(struct blkcg_policy *pol) · 155 unmodified lines
1266 1267
1267 /* everything is in place, add intf files for the new policy */1268 /* everything is in place, add intf files for the new policy */
1268 if (pol->cftypes)1269 if (pol->cftypes)
1269 WARN_ON(cgroup_add_legacy_cftypes(&blkio_cgrp_subsys,1270 WARN_ON(cgroup_add_legacy_cftypes(&io_cgrp_subsys,
1270 pol->cftypes));1271 pol->cftypes));
1271 mutex_unlock(&blkcg_pol_register_mutex);1272 mutex_unlock(&blkcg_pol_register_mutex);
1272 return 0;1273 return 0;
include/linux/backing-dev.h+1−1
@@ -286,7 +286,7 @@ static inline struct bdi_writeback *wb_find_current(struct backing_dev_info *bdi · 285 unmodified lines
286 * %current's blkcg equals the effective blkcg of its memcg. No286 * %current's blkcg equals the effective blkcg of its memcg. No
287 * need to use the relatively expensive cgroup_get_e_css().287 * need to use the relatively expensive cgroup_get_e_css().
288 */288 */
289 if (likely(wb && wb->blkcg_css == task_css(current, blkio_cgrp_id)))289 if (likely(wb && wb->blkcg_css == task_css(current, io_cgrp_id)))
290 return wb;290 return wb;
291 return NULL;291 return NULL;
292}292}
include/linux/blk-cgroup.h+2−2
@@ -221,7 +221,7 @@ static inline struct blkcg *css_to_blkcg(struct cgroup_subsys_state *css) · 220 unmodified lines
221 221
222static inline struct blkcg *task_blkcg(struct task_struct *tsk)222static inline struct blkcg *task_blkcg(struct task_struct *tsk)
223{223{
224 return css_to_blkcg(task_css(tsk, blkio_cgrp_id));224 return css_to_blkcg(task_css(tsk, io_cgrp_id));
225}225}
226 226
227static inline struct blkcg *bio_blkcg(struct bio *bio)227static inline struct blkcg *bio_blkcg(struct bio *bio)
@@ -234,7 +234,7 @@ static inline struct blkcg *bio_blkcg(struct bio *bio) · 6 unmodified lines
234static inline struct cgroup_subsys_state *234static inline struct cgroup_subsys_state *
235task_get_blkcg_css(struct task_struct *task)235task_get_blkcg_css(struct task_struct *task)
236{236{
237 return task_get_css(task, blkio_cgrp_id);237 return task_get_css(task, io_cgrp_id);
238}238}
239 239
240/**240/**
include/linux/cgroup_subsys.h+1−1
@@ -16,7 +16,7 @@ SUBSYS(cpuacct) · 15 unmodified lines
16#endif16#endif
17 17
18#if IS_ENABLED(CONFIG_BLK_CGROUP)18#if IS_ENABLED(CONFIG_BLK_CGROUP)
19SUBSYS(blkio)19SUBSYS(io)
20#endif20#endif
21 21
22#if IS_ENABLED(CONFIG_MEMCG)22#if IS_ENABLED(CONFIG_MEMCG)
mm/backing-dev.c+2−2
@@ -523,7 +523,7 @@ static int cgwb_create(struct backing_dev_info *bdi, · 522 unmodified lines
523 int ret = 0;523 int ret = 0;
524 524
525 memcg = mem_cgroup_from_css(memcg_css);525 memcg = mem_cgroup_from_css(memcg_css);
526 blkcg_css = cgroup_get_e_css(memcg_css->cgroup, &blkio_cgrp_subsys);526 blkcg_css = cgroup_get_e_css(memcg_css->cgroup, &io_cgrp_subsys);
527 blkcg = css_to_blkcg(blkcg_css);527 blkcg = css_to_blkcg(blkcg_css);
528 memcg_cgwb_list = mem_cgroup_cgwb_list(memcg);528 memcg_cgwb_list = mem_cgroup_cgwb_list(memcg);
529 blkcg_cgwb_list = &blkcg->cgwb_list;529 blkcg_cgwb_list = &blkcg->cgwb_list;
@@ -645,7 +645,7 @@ struct bdi_writeback *wb_get_create(struct backing_dev_info *bdi, · 115 unmodified lines
645 645
646 /* see whether the blkcg association has changed */646 /* see whether the blkcg association has changed */
647 blkcg_css = cgroup_get_e_css(memcg_css->cgroup,647 blkcg_css = cgroup_get_e_css(memcg_css->cgroup,
648 &blkio_cgrp_subsys);648 &io_cgrp_subsys);
649 if (unlikely(wb->blkcg_css != blkcg_css ||649 if (unlikely(wb->blkcg_css != blkcg_css ||
650 !wb_tryget(wb)))650 !wb_tryget(wb)))
651 wb = NULL;651 wb = NULL;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t