]> git.karo-electronics.de Git - karo-tx-linux.git/commit
cgroups: ability to stop res charge propagation on bounded ancestor
authorFrederic Weisbecker <fweisbec@gmail.com>
Tue, 8 Nov 2011 00:20:20 +0000 (11:20 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 16 Nov 2011 01:47:08 +0000 (12:47 +1100)
commitfb43127f7753eb5757e9609c905d77a6f2cf7cbc
tree2ab679cbe9ec64edbea208de744a420eae009f4a
parent8ca5eb4627052f86f902af25509b0aa020727ebc
cgroups: ability to stop res charge propagation on bounded ancestor

Moving a task from a cgroup to another may require to substract its
resource charge from the old cgroup and add it to the new one.

For this to happen, the uncharge/charge propagation can just stop when we
reach the common ancestor for the two cgroups.  Further the performance
reasons, we also want to avoid to temporarily overload the common
ancestors with a non-accurate resource counter usage if we charge first
the new cgroup and uncharge the old one thereafter.  This is going to be a
requirement for the coming max number of task subsystem.

To solve this, provide a pair of new API that can charge/uncharge a
resource counter until we reach a given ancestor.

Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Acked-by: Paul Menage <paul@paulmenage.org>
Cc: Li Zefan <lizf@cn.fujitsu.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Aditya Kali <adityakali@google.com>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Cc: Tim Hockin <thockin@hockin.org>
Cc: Tejun Heo <htejun@gmail.com>
Acked-by: Kirill A. Shutemov <kirill@shutemov.name>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Documentation/cgroups/resource_counter.txt
include/linux/res_counter.h
kernel/res_counter.c