Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 58611b56 authored by Vic Yang's avatar Vic Yang Committed by android-build-merger
Browse files

Merge "libprocessgroup: Fix memcg path for apps" am: 1cae1b0f

am: 8a4f601c

Change-Id: I1880dffa5b056d56620b1dff37f0a65b27a8379e
parents e2869a0b 8a4f601c
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -200,7 +200,7 @@ void removeAllProcessGroups() {
        cgroups.push_back(path);
    }
    if (CgroupGetControllerPath("memory", &path)) {
        cgroups.push_back(path);
        cgroups.push_back(path + "/apps");
    }

    for (std::string cgroup_root_path : cgroups) {
@@ -317,6 +317,7 @@ static int KillProcessGroup(uid_t uid, int initialPid, int signal, int retries)

    CgroupGetControllerPath("cpuacct", &cpuacct_path);
    CgroupGetControllerPath("memory", &memory_path);
    memory_path += "/apps";

    const char* cgroup =
            (!access(ConvertUidPidToPath(cpuacct_path.c_str(), uid, initialPid).c_str(), F_OK))
@@ -380,6 +381,7 @@ int createProcessGroup(uid_t uid, int initialPid, bool memControl) {
    std::string cgroup;
    if (isMemoryCgroupSupported() && (memControl || UsePerAppMemcg())) {
        CgroupGetControllerPath("memory", &cgroup);
        cgroup += "/apps";
    } else {
        CgroupGetControllerPath("cpuacct", &cgroup);
    }