diff options
author | Robert Benea <robenea@google.com> | 2017-06-27 23:09:03 -0700 |
---|---|---|
committer | Robert Benea <robenea@google.com> | 2017-07-11 12:48:10 -0700 |
commit | 3280e48847e5dd16521ad7040d53eb30b66bf740 (patch) | |
tree | 28496ac5091fbd565260e587d68d329a3f3db0be /libprocessgroup/processgroup.cpp | |
parent | 896297b2ef10a58fc614aebce8724d342d81f85e (diff) | |
download | core-3280e48847e5dd16521ad7040d53eb30b66bf740.tar.gz core-3280e48847e5dd16521ad7040d53eb30b66bf740.tar.bz2 core-3280e48847e5dd16521ad7040d53eb30b66bf740.zip |
Use mem cgroups in libprocessgroup if they're available
Use mem cgroups if the kernel is built with CONFIG_MEMCG=y,
additionally add system group.
test: verified on both kernel with/without memcg enabled
Change-Id: Ia2ae89efa3905e9da68fa77adac1225c667864d1
Diffstat (limited to 'libprocessgroup/processgroup.cpp')
-rw-r--r-- | libprocessgroup/processgroup.cpp | 7 |
1 files changed, 0 insertions, 7 deletions
diff --git a/libprocessgroup/processgroup.cpp b/libprocessgroup/processgroup.cpp index f5d4e1c9e..9b8248e88 100644 --- a/libprocessgroup/processgroup.cpp +++ b/libprocessgroup/processgroup.cpp @@ -43,9 +43,6 @@ 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" @@ -91,7 +88,6 @@ 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 @@ -100,9 +96,6 @@ 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) |