Commit graph

5 commits

Author SHA1 Message Date
Peter Collingbourne
d7157c22af Introduce additional service options for controlling memory cgroups.
The memcg.limit_percent option can be used to limit the cgroup's
max RSS to the given value as a percentage of the device's physical
memory. The memcg.limit_property option specifies the name of a
property that can be used to control the cgroup's max RSS. These
new options correspond to the arguments to the limitProcessMemory
function in frameworks/av/media/libmedia/MediaUtils.cpp; this will
allow us to add these options to the rc files for the programs that
call this function and then remove the callers in a later change.

There is also a change in semantics: the memcg.* options now have
an effect on all devices which support memory cgroups, not just
those with ro.config.low_ram or ro.config.per_app_memcg set to true.
This change also brings the semantics in line with the documentation,
so it looks like the previous semantics were unintentional.

Change-Id: I9495826de6e477b952e23866743b5fa600adcacb
Bug: 118642754
2018-10-31 17:09:59 -07:00
Robert Benea
d485226951 Add memcg related configs to init.
Allow configuring memory.swappiness, memory.soft_limit_in_bytes
and memory.limit_in_bytes by init; by doing so there is better
control of memory consumption per native app.

Test: tested on gobo branch.
bug: 63765067
Change-Id: I8906f3ff5ef77f75a0f4cdfbf9d424a579ed52bb
2017-07-18 15:58:40 -07:00
Tom Cherry
20514c4411 Better logging in libprocessgroup and make resources clean up themselves
Bug: 36661364
Bug: 36701253
Bug: 37540956

Test: Reboot bullhead
Test: Start and stop services
Change-Id: I97b6e17a7350850db733bee9fc83bdd296d88c61
2017-05-04 12:18:57 -07:00
Keun-young Park
fac4b63eff add killProcessGroupOnce
- killProcessGroup retries if it fails while
  killProcessGroupOnce only tries once.
- useful for sending signal like SIGTERM once.

bug: 36696408
Test: will add usage to init
Change-Id: Ia1e3d4ec848e785a3238f262b02914695cded4c7
2017-03-29 16:33:15 -07:00
Colin Cross
cf8d1c22f7 Add libprocessgroup
libprocessgroup will allow Zygote to place processes
in a cgroup, and then kill the process and all forked processes
later.  lmkd will also kill all forked processes.

Bug: 15313911
Change-Id: I20404d0dbe448f1c475d2f4c61cccca462f9e544
2014-07-09 17:24:39 -07:00