diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-01-21 20:51:34 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-01-21 20:51:34 -0500 |
| commit | f075e0f6993f41c72dbb1d3e7a2d7740f14e89e2 (patch) | |
| tree | a25b464a67fffc6f43940e0e85e2735a48bb1ad7 | |
| parent | 5cb7398caf69e3943df78435a19a8a77fe8b9463 (diff) | |
| parent | dd4b0a4676907481256d16d5de0851b315a6f22c (diff) | |
Merge branch 'for-3.14' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup
Pull cgroup updates from Tejun Heo:
"The bulk of changes are cleanups and preparations for the upcoming
kernfs conversion.
- cgroup_event mechanism which is and will be used only by memcg is
moved to memcg.
- pidlist handling is updated so that it can be served by seq_file.
Also, the list is not sorted if sane_behavior. cgroup
documentation explicitly states that the file is not sorted but it
has been for quite some time.
- All cgroup file handling now happens on top of seq_file. This is
to prepare for kernfs conversion. In addition, all operations are
restructured so that they map 1-1 to kernfs operations.
- Other cleanups and low-pri fixes"
* 'for-3.14' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup: (40 commits)
cgroup: trivial style updates
cgroup: remove stray references to css_id
doc: cgroups: Fix typo in doc/cgroups
cgroup: fix fail path in cgroup_load_subsys()
cgroup: fix missing unlock on error in cgroup_load_subsys()
cgroup: remove for_each_root_subsys()
cgroup: implement for_each_css()
cgroup: factor out cgroup_subsys_state creation into create_css()
cgroup: combine css handling loops in cgroup_create()
cgroup: reorder operations in cgroup_create()
cgroup: make for_each_subsys() useable under cgroup_root_mutex
cgroup: css iterations and css_from_dir() are safe under cgroup_mutex
cgroup: unify pidlist and other file handling
cgroup: replace cftype->read_seq_string() with cftype->seq_show()
cgroup: attach cgroup_open_file to all cgroup files
cgroup: generalize cgroup_pidlist_open_file
cgroup: unify read path so that seq_file is always used
cgroup: unify cgroup_write_X64() and cgroup_write_string()
cgroup: remove cftype->read(), ->read_map() and ->write()
hugetlb_cgroup: convert away from cftype->read()
...
| -rw-r--r-- | Documentation/cgroups/cgroups.txt | 20 | ||||
| -rw-r--r-- | Documentation/cgroups/memory.txt | 4 | ||||
| -rw-r--r-- | Documentation/cgroups/resource_counter.txt | 4 | ||||
| -rw-r--r-- | block/blk-throttle.c | 35 | ||||
| -rw-r--r-- | block/cfq-iosched.c | 131 | ||||
| -rw-r--r-- | drivers/md/bcache/request.c | 1 | ||||
| -rw-r--r-- | include/linux/cgroup.h | 112 | ||||
| -rw-r--r-- | include/linux/vmpressure.h | 8 | ||||
| -rw-r--r-- | init/Kconfig | 3 | ||||
| -rw-r--r-- | kernel/cgroup.c | 1202 | ||||
| -rw-r--r-- | kernel/cgroup_freezer.c | 7 | ||||
| -rw-r--r-- | kernel/cpuset.c | 71 | ||||
| -rw-r--r-- | kernel/sched/core.c | 13 | ||||
| -rw-r--r-- | kernel/sched/cpuacct.c | 18 | ||||
| -rw-r--r-- | mm/hugetlb_cgroup.c | 22 | ||||
| -rw-r--r-- | mm/memcontrol.c | 426 | ||||
| -rw-r--r-- | mm/page_cgroup.c | 2 | ||||
| -rw-r--r-- | mm/vmpressure.c | 26 | ||||
| -rw-r--r-- | net/core/netprio_cgroup.c | 8 | ||||
| -rw-r--r-- | security/device_cgroup.c | 7 |
20 files changed, 1022 insertions, 1098 deletions
diff --git a/Documentation/cgroups/cgroups.txt b/Documentation/cgroups/cgroups.txt index 638bf17ff869..821de56d1580 100644 --- a/Documentation/cgroups/cgroups.txt +++ b/Documentation/cgroups/cgroups.txt | |||
| @@ -24,7 +24,6 @@ CONTENTS: | |||
| 24 | 2.1 Basic Usage | 24 | 2.1 Basic Usage |
| 25 | 2.2 Attaching processes | 25 | 2.2 Attaching processes |
| 26 | 2.3 Mounting hierarchies by name | 26 | 2.3 Mounting hierarchies by name |
| 27 | 2.4 Notification API | ||
| 28 | 3. Kernel API | 27 | 3. Kernel API |
| 29 | 3.1 Overview | 28 | 3.1 Overview |
| 30 | 3.2 Synchronization | 29 | 3.2 Synchronization |
| @@ -472,25 +471,6 @@ you give a subsystem a name. | |||
| 472 | The name of the subsystem appears as part of the hierarchy description | 471 | The name of the subsystem appears as part of the hierarchy description |
| 473 | in /proc/mounts and /proc/<pid>/cgroups. | 472 | in /proc/mounts and /proc/<pid>/cgroups. |
| 474 | 473 | ||
| 475 | 2.4 Notification API | ||
| 476 | -------------------- | ||
| 477 | |||
| 478 | There is mechanism which allows to get notifications about changing | ||
| 479 | status of a cgroup. | ||
| 480 | |||
| 481 | To register a new notification handler you need to: | ||
| 482 | - create a file descriptor for event notification using eventfd(2); | ||
| 483 | - open a control file to be monitored (e.g. memory.usage_in_bytes); | ||
| 484 | - write "<event_fd> <control_fd> <args>" to cgroup.event_control. | ||
| 485 | Interpretation of args is defined by control file implementation; | ||
| 486 | |||
| 487 | eventfd will be woken up by control file implementation or when the | ||
| 488 | cgroup is removed. | ||
| 489 | |||
| 490 | To unregister a notification handler just close eventfd. | ||
| 491 | |||
| 492 | NOTE: Support of notifications should be implemented for the control | ||
| 493 | file. See documentation for the subsystem. | ||
| 494 | 474 | ||
| 495 | 3. Kernel API | 475 | 3. Kernel API |
| 496 | ============= | 476 | ============= |
diff --git a/Documentation/cgroups/memory.txt b/Documentation/cgroups/memory.txt index e2bc132608fd..2622115276aa 100644 --- a/Documentation/cgroups/memory.txt +++ b/Documentation/cgroups/memory.txt | |||
| @@ -577,7 +577,7 @@ Each memcg's numa_stat file includes "total", "file", "anon" and "unevictable" | |||
| 577 | per-node page counts including "hierarchical_<counter>" which sums up all | 577 | per-node page counts including "hierarchical_<counter>" which sums up all |
| 578 | hierarchical children's values in addition to the memcg's own value. | 578 | hierarchical children's values in addition to the memcg's own value. |
| 579 | 579 | ||
| 580 | The ouput format of memory.numa_stat is: | 580 | The output format of memory.numa_stat is: |
| 581 | 581 | ||
| 582 | total=<total pages> N0=<node 0 pages> N1=<node 1 pages> ... | 582 | total=<total pages> N0=<node 0 pages> N1=<node 1 pages> ... |
| 583 | file=<total file pages> N0=<node 0 pages> N1=<node 1 pages> ... | 583 | file=<total file pages> N0=<node 0 pages> N1=<node 1 pages> ... |
| @@ -670,7 +670,7 @@ page tables. | |||
| 670 | 670 | ||
| 671 | 8.1 Interface | 671 | 8.1 Interface |
| 672 | 672 | ||
| 673 | This feature is disabled by default. It can be enabledi (and disabled again) by | 673 | This feature is disabled by default. It can be enabled (and disabled again) by |
| 674 | writing to memory.move_charge_at_immigrate of the destination cgroup. | 674 | writing to memory.move_charge_at_immigrate of the destination cgroup. |
| 675 | 675 | ||
| 676 | If you want to enable it: | 676 | If you want to enable it: |
diff --git a/Documentation/cgroups/resource_counter.txt b/Documentation/cgroups/resource_counter.txt index c4d99ed0b418..52e1da16a309 100644 --- a/Documentation/cgroups/resource_counter.txt +++ b/Documentation/cgroups/resource_counter.txt | |||
| @@ -97,8 +97,8 @@ to work with it. | |||
| 97 | (struct res_counter *rc, struct res_counter *top, | 97 | (struct res_counter *rc, struct res_counter *top, |
| 98 | unsinged long val) | 98 | unsinged long val) |
| 99 | 99 | ||
| 100 | Almost same as res_cunter_uncharge() but propagation of uncharge | 100 | Almost same as res_counter_uncharge() but propagation of uncharge |
| 101 | stops when rc == top. This is useful when kill a res_coutner in | 101 | stops when rc == top. This is useful when kill a res_counter in |
| 102 | child cgroup. | 102 | child cgroup. |
| 103 | 103 | ||
| 104 | 2.1 Other accounting routines | 104 | 2.1 Other accounting routines |
diff --git a/block/blk-throttle.c b/block/blk-throttle.c index 06534049afba..a760857e6b62 100644 --- a/block/blk-throttle.c +++ b/block/blk-throttle.c | |||
| @@ -1303,13 +1303,10 @@ static u64 tg_prfill_cpu_rwstat(struct seq_file *sf, | |||
| 1303 | return __blkg_prfill_rwstat(sf, pd, &rwstat); | 1303 | return __blkg_prfill_rwstat(sf, pd, &rwstat); |
| 1304 | } | 1304 | } |
| 1305 | 1305 | ||
| 1306 | static int tg_print_cpu_rwstat(struct cgroup_subsys_state *css, | 1306 | static int tg_print_cpu_rwstat(struct seq_file *sf, void *v) |
| 1307 | struct cftype *cft, struct seq_file *sf) | ||
| 1308 | { | 1307 | { |
| 1309 | struct blkcg *blkcg = css_to_blkcg(css); | 1308 | blkcg_print_blkgs(sf, css_to_blkcg(seq_css(sf)), tg_prfill_cpu_rwstat, |
| 1310 | 1309 | &blkcg_policy_throtl, seq_cft(sf)->private, true); | |
| 1311 | blkcg_print_blkgs(sf, blkcg, tg_prfill_cpu_rwstat, &blkcg_policy_throtl, | ||
| 1312 | cft->private, true); | ||
| 1313 | return 0; | 1310 | return 0; |
| 1314 | } | 1311 | } |
| 1315 | 1312 | ||
| @@ -1335,19 +1332,17 @@ static u64 tg_prfill_conf_uint(struct seq_file *sf, struct blkg_policy_data *pd, | |||
| 1335 | return __blkg_prfill_u64(sf, pd, v); | 1332 | return __blkg_prfill_u64(sf, pd, v); |
| 1336 | } | 1333 | } |
| 1337 | 1334 | ||
| 1338 | static int tg_print_conf_u64(struct cgroup_subsys_state *css, | 1335 | static int tg_print_conf_u64(struct seq_file *sf, void *v) |
| 1339 | struct cftype *cft, struct seq_file *sf) | ||
| 1340 | { | 1336 | { |
| 1341 | blkcg_print_blkgs(sf, css_to_blkcg(css), tg_prfill_conf_u64, | 1337 | blkcg_print_blkgs(sf, css_to_blkcg(seq_css(sf)), tg_prfill_conf_u64, |
| 1342 | &blkcg_policy_throtl, cft->private, false); | 1338 | &blkcg_policy_throtl, seq_cft(sf)->private, false); |
| 1343 | return 0; | 1339 | return 0; |
| 1344 | } | 1340 | } |
| 1345 | 1341 | ||
| 1346 | static int tg_print_conf_uint(struct cgroup_subsys_state *css, | 1342 | static int tg_print_conf_uint(struct seq_file *sf, void *v) |
| 1347 | struct cftype *cft, struct seq_file *sf) | ||
| 1348 | { | 1343 | { |
| 1349 | blkcg_print_blkgs(sf, css_to_blkcg(css), tg_prfill_conf_uint, | 1344 | blkcg_print_blkgs(sf, css_to_blkcg(seq_css(sf)), tg_prfill_conf_uint, |
| 1350 | &blkcg_policy_throtl, cft->private, false); | 1345 | &blkcg_policy_throtl, seq_cft(sf)->private, false); |
| 1351 | return 0; | 1346 | return 0; |
| 1352 | } | 1347 | } |
| 1353 | 1348 | ||
| @@ -1428,40 +1423,40 @@ static struct cftype throtl_files[] = { | |||
| 1428 | { | 1423 | { |
| 1429 | .name = "throttle.read_bps_device", | 1424 | .name = "throttle.read_bps_device", |
| 1430 | .private = offsetof(struct throtl_grp, bps[READ]), | 1425 | .private = offsetof(struct throtl_grp, bps[READ]), |
| 1431 | .read_seq_string = tg_print_conf_u64, | 1426 | .seq_show = tg_print_conf_u64, |
| 1432 | .write_string = tg_set_conf_u64, | 1427 | .write_string = tg_set_conf_u64, |
| 1433 | .max_write_len = 256, | 1428 | .max_write_len = 256, |
| 1434 | }, | 1429 | }, |
| 1435 | { | 1430 | { |
| 1436 | .name = "throttle.write_bps_device", | 1431 | .name = "throttle.write_bps_device", |
| 1437 | .private = offsetof(struct throtl_grp, bps[WRITE]), | 1432 | .private = offsetof(struct throtl_grp, bps[WRITE]), |
| 1438 | .read_seq_string = tg_print_conf_u64, | 1433 | .seq_show = tg_print_conf_u64, |
| 1439 | .write_string = tg_set_conf_u64, | 1434 | .write_string = tg_set_conf_u64, |
| 1440 | .max_write_len = 256, | 1435 | .max_write_len = 256, |
| 1441 | }, | ||
