diff options
author | Martijn Coenen <maco@google.com> | 2016-01-20 16:39:16 -0800 |
---|---|---|
committer | Martijn Coenen <maco@google.com> | 2016-02-01 21:04:24 +0100 |
commit | b82bab66f318896ebad80c1feee2347c58e3ce37 (patch) | |
tree | ff971f83721d006df7150c8a53f440d246d33c36 /rootdir/init.rc | |
parent | c003b515e9668ee91d14eea124b66f6bcef89377 (diff) |
Reuse mem cgroups for tracking forked PIDs.
It turns out we were using the CPU accounting
cgroups for keeping track of processes that were
forked by an app without the framework's knowledge,
so we could kill all of them reliably (see b/15313911
for context).
Since we want to use memory cgroups for other purposes,
we might as well use memory cgroups for tracking forked
PIDs if they're enabled. This also gets us automatic cleanup
of empty mem cgroups.
Also, removed old mem cgroup mount point that is no
longer used, as well as cgroup release agent code that
we're not using.
Change-Id: I69d5cc31c162ffa49ef6945755f41381e306cc8b
Diffstat (limited to 'rootdir/init.rc')
-rw-r--r-- | rootdir/init.rc | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/rootdir/init.rc b/rootdir/init.rc index 441f28b10..11c859eb0 100644 --- a/rootdir/init.rc +++ b/rootdir/init.rc @@ -43,19 +43,6 @@ on init mount cgroup none /acct cpuacct mkdir /acct/uid - # Create cgroup mount point for memory - mount tmpfs none /sys/fs/cgroup mode=0750,uid=0,gid=1000 - mkdir /sys/fs/cgroup/memory 0750 root system - mount cgroup none /sys/fs/cgroup/memory memory - write /sys/fs/cgroup/memory/memory.move_charge_at_immigrate 1 - chown root system /sys/fs/cgroup/memory/tasks - chmod 0660 /sys/fs/cgroup/memory/tasks - mkdir /sys/fs/cgroup/memory/sw 0750 root system - write /sys/fs/cgroup/memory/sw/memory.swappiness 100 - write /sys/fs/cgroup/memory/sw/memory.move_charge_at_immigrate 1 - chown root system /sys/fs/cgroup/memory/sw/tasks - chmod 0660 /sys/fs/cgroup/memory/sw/tasks - # Create energy-aware scheduler tuning nodes mkdir /sys/fs/cgroup/stune mount cgroup none /sys/fs/cgroup/stune schedtune @@ -95,9 +82,11 @@ on init symlink /storage/self/primary /sdcard symlink /mnt/user/0/primary /mnt/runtime/default/self/primary - # memory control cgroup + # root memory control cgroup, used by lmkd mkdir /dev/memcg 0700 root system mount cgroup none /dev/memcg memory + # app mem cgroups, used by activity manager and lmkd + mkdir /dev/memcg/apps/ 0755 system system write /proc/sys/kernel/panic_on_oops 1 write /proc/sys/kernel/hung_task_timeout_secs 0 |