alistair23-linux/Documentation/cgroups
Michal Hocko f61c42a7d9 memcg: remove tasks/children test from mem_cgroup_force_empty()
Tejun has correctly pointed out that tasks/children test in
mem_cgroup_force_empty is not correct because there is no other locking
which preserves this state throughout the rest of the function so both
new tasks can join the group or new children groups can be added while
somebody is writing to memory.force_empty. A new task would break
mem_cgroup_reparent_charges expectation that all failures as described
by mem_cgroup_force_empty_list are temporal and there is no way out.

The main use case for the knob as described by
Documentation/cgroups/memory.txt is to:
"
  The typical use case for this interface is before calling rmdir().
  Because rmdir() moves all pages to parent, some out-of-use page caches can be
  moved to the parent. If you want to avoid that, force_empty will be useful.
"

This means that reparenting is not really required as rmdir will
reparent pages implicitly from the safe context. If we remove it from
mem_cgroup_force_empty then we are safe even with existing tasks because
the number of reclaim attempts is bounded. Moreover the knob still does
what the documentation claims (modulo reparenting which doesn't make any
difference) and users might expect. Longterm we want to deprecate the
whole knob and put the reparented pages to the tail of parent LRU during
cgroup removal.

tj: Removed unused variable @cgrp from mem_cgroup_force_empty()

Signed-off-by: Michal Hocko <mhocko@suse.cz>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Acked-by: Li Zefan <lizefan@huawei.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
2014-05-16 13:22:48 -04:00
..
00-INDEX Documentation: cgroup: add documentation for net_cls cgroups. 2013-04-08 16:55:28 -04:00
blkio-controller.txt blk-throttle: implement proper hierarchy support 2013-05-14 13:52:38 -07:00
cgroups.txt memcg: rename cgroup_event to mem_cgroup_event 2013-11-22 18:20:44 -05:00
cpuacct.txt
cpusets.txt sched: Rename sched.c as sched/core.c in comments and Documentation 2013-06-19 12:58:42 +02:00
devices.txt devcg: propagate local changes down the hierarchy 2013-03-20 07:50:21 -07:00
freezer-subsystem.txt
hugetlb.txt
memcg_test.txt memcg: rename high level charging functions 2014-04-07 16:35:57 -07:00
memory.txt memcg: remove tasks/children test from mem_cgroup_force_empty() 2014-05-16 13:22:48 -04:00
net_cls.txt netfilter: x_tables: lightweight process control group matching 2014-01-03 23:41:44 +01:00
net_prio.txt
resource_counter.txt res_counter: remove interface for locked charging and uncharging 2014-04-07 16:35:54 -07:00
unified-hierarchy.txt cgroup: add documentation about unified hierarchy 2014-04-25 18:28:02 -04:00