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
20462046
20472047 get_io_context_active(ioc);
20482048 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);
20502050 return 0;
20512051 }
20522052 EXPORT_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
10891089 return ret;
10901090 }
10911091
1092−struct cgroup_subsys blkio_cgrp_subsys = {
1092+struct cgroup_subsys io_cgrp_subsys = {
10931093 .css_alloc = blkcg_css_alloc,
10941094 .css_offline = blkcg_css_offline,
10951095 .css_free = blkcg_css_free,
10961096 .can_attach = blkcg_can_attach,
10971097 .legacy_cftypes = blkcg_files,
1098+ .legacy_name = "blkio",
10981099 #ifdef CONFIG_MEMCG
10991100 /*
11001101 * This ensures that, if available, memcg is automatically enabled
@@ -1104,7 +1105,7 @@ struct cgroup_subsys blkio_cgrp_subsys = { · 3 unmodified lines
11041105 .depends_on = 1 << memory_cgrp_id,
11051106 #endif
11061107 };
1107−EXPORT_SYMBOL_GPL(blkio_cgrp_subsys);
1108+EXPORT_SYMBOL_GPL(io_cgrp_subsys);
11081109
11091110 /**
11101111 * 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
12661267
12671268 /* everything is in place, add intf files for the new policy */
12681269 if (pol->cftypes)
1269− WARN_ON(cgroup_add_legacy_cftypes(&blkio_cgrp_subsys,
1270+ WARN_ON(cgroup_add_legacy_cftypes(&io_cgrp_subsys,
12701271 pol->cftypes));
12711272 mutex_unlock(&blkcg_pol_register_mutex);
12721273 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
286286 * %current's blkcg equals the effective blkcg of its memcg. No
287287 * need to use the relatively expensive cgroup_get_e_css().
288288 */
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)))
290290 return wb;
291291 return NULL;
292292 }
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
221221
222222 static inline struct blkcg *task_blkcg(struct task_struct *tsk)
223223 {
224− return css_to_blkcg(task_css(tsk, blkio_cgrp_id));
224+ return css_to_blkcg(task_css(tsk, io_cgrp_id));
225225 }
226226
227227 static inline struct blkcg *bio_blkcg(struct bio *bio)
@@ -234,7 +234,7 @@ static inline struct blkcg *bio_blkcg(struct bio *bio) · 6 unmodified lines
234234 static inline struct cgroup_subsys_state *
235235 task_get_blkcg_css(struct task_struct *task)
236236 {
237− return task_get_css(task, blkio_cgrp_id);
237+ return task_get_css(task, io_cgrp_id);
238238 }
239239
240240 /**
include/linux/cgroup_subsys.h+1−1
@@ -16,7 +16,7 @@ SUBSYS(cpuacct) · 15 unmodified lines
1616 #endif
1717
1818 #if IS_ENABLED(CONFIG_BLK_CGROUP)
19−SUBSYS(blkio)
19+SUBSYS(io)
2020 #endif
2121
2222 #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
523523 int ret = 0;
524524
525525 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);
527527 blkcg = css_to_blkcg(blkcg_css);
528528 memcg_cgwb_list = mem_cgroup_cgwb_list(memcg);
529529 blkcg_cgwb_list = &blkcg->cgwb_list;
@@ -645,7 +645,7 @@ struct bdi_writeback *wb_get_create(struct backing_dev_info *bdi, · 115 unmodified lines
645645
646646 /* see whether the blkcg association has changed */
647647 blkcg_css = cgroup_get_e_css(memcg_css->cgroup,
648− &blkio_cgrp_subsys);
648+ &io_cgrp_subsys);
649649 if (unlikely(wb->blkcg_css != blkcg_css ||
650650 !wb_tryget(wb)))
651651 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