Merge "Use mem cgroups in libprocessgroup if they're available" am: d3afc124b6 am: 46706e6824
am: 74c02e7b58
Change-Id: Iba2c643286063a9ffa22f3917f8acbcca1d77ef3
This commit is contained in:
commit
888d9e198b
2 changed files with 2 additions and 7 deletions
|
|
@ -43,9 +43,6 @@
|
||||||
|
|
||||||
using namespace std::chrono_literals;
|
using namespace std::chrono_literals;
|
||||||
|
|
||||||
// Uncomment line below use memory cgroups for keeping track of (forked) PIDs
|
|
||||||
// #define USE_MEMCG 1
|
|
||||||
|
|
||||||
#define MEM_CGROUP_PATH "/dev/memcg/apps"
|
#define MEM_CGROUP_PATH "/dev/memcg/apps"
|
||||||
#define MEM_CGROUP_TASKS "/dev/memcg/apps/tasks"
|
#define MEM_CGROUP_TASKS "/dev/memcg/apps/tasks"
|
||||||
#define ACCT_CGROUP_PATH "/acct"
|
#define ACCT_CGROUP_PATH "/acct"
|
||||||
|
|
@ -91,7 +88,6 @@ class ProcessGroup {
|
||||||
};
|
};
|
||||||
|
|
||||||
static const char* getCgroupRootPath() {
|
static const char* getCgroupRootPath() {
|
||||||
#ifdef USE_MEMCG
|
|
||||||
static const char* cgroup_root_path = NULL;
|
static const char* cgroup_root_path = NULL;
|
||||||
std::call_once(init_path_flag, [&]() {
|
std::call_once(init_path_flag, [&]() {
|
||||||
// Check if mem cgroup is mounted, only then check for write-access to avoid
|
// Check if mem cgroup is mounted, only then check for write-access to avoid
|
||||||
|
|
@ -100,9 +96,6 @@ static const char* getCgroupRootPath() {
|
||||||
ACCT_CGROUP_PATH : MEM_CGROUP_PATH;
|
ACCT_CGROUP_PATH : MEM_CGROUP_PATH;
|
||||||
});
|
});
|
||||||
return cgroup_root_path;
|
return cgroup_root_path;
|
||||||
#else
|
|
||||||
return ACCT_CGROUP_PATH;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int convertUidToPath(char *path, size_t size, uid_t uid)
|
static int convertUidToPath(char *path, size_t size, uid_t uid)
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,8 @@ on early-init
|
||||||
mount cgroup none /dev/memcg memory
|
mount cgroup none /dev/memcg memory
|
||||||
# app mem cgroups, used by activity manager, lmkd and zygote
|
# app mem cgroups, used by activity manager, lmkd and zygote
|
||||||
mkdir /dev/memcg/apps/ 0755 system system
|
mkdir /dev/memcg/apps/ 0755 system system
|
||||||
|
# cgroup for system_server and surfaceflinger
|
||||||
|
mkdir /dev/memcg/system 0755 system system
|
||||||
|
|
||||||
start ueventd
|
start ueventd
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue