Merge "Revert "Use mem cgroups in libprocessgroup if they're available"" am: e8a75e8f76 am: 7f857bb9ff am: ac68c7fc8c

am: 2c0f9c3a72

Change-Id: I36ef31b921d56222902c4bba8f891d6d21dad947
This commit is contained in:
Tim Murray 2017-07-08 01:52:51 +00:00 committed by android-build-merger
commit 7af0deb144
2 changed files with 7 additions and 2 deletions

View file

@ -43,6 +43,9 @@
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_TASKS "/dev/memcg/apps/tasks"
#define ACCT_CGROUP_PATH "/acct"
@ -88,6 +91,7 @@ class ProcessGroup {
};
static const char* getCgroupRootPath() {
#ifdef USE_MEMCG
static const char* cgroup_root_path = NULL;
std::call_once(init_path_flag, [&]() {
// Check if mem cgroup is mounted, only then check for write-access to avoid
@ -96,6 +100,9 @@ static const char* getCgroupRootPath() {
ACCT_CGROUP_PATH : MEM_CGROUP_PATH;
});
return cgroup_root_path;
#else
return ACCT_CGROUP_PATH;
#endif
}
static int convertUidToPath(char *path, size_t size, uid_t uid)

View file

@ -36,8 +36,6 @@ on early-init
mount cgroup none /dev/memcg memory
# app mem cgroups, used by activity manager, lmkd and zygote
mkdir /dev/memcg/apps/ 0755 system system
# cgroup for system_server and surfaceflinger
mkdir /dev/memcg/system 0755 system system
start ueventd