Merge "libprocessgroup: Remove isolated UID cgroup directories" into main am: 30718e7431 am: 3cc3e8d498
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2654188 Change-Id: I198cfc5aa1bed99fe7e116749ea21e0cc87829bf Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
commit
111e2eb377
1 changed files with 7 additions and 0 deletions
|
|
@ -223,6 +223,13 @@ static int RemoveProcessGroup(const char* cgroup, uid_t uid, int pid, unsigned i
|
||||||
std::this_thread::sleep_for(5ms);
|
std::this_thread::sleep_for(5ms);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!ret && uid >= AID_ISOLATED_START && uid <= AID_ISOLATED_END) {
|
||||||
|
// Isolated UIDs are unlikely to be reused soon after removal,
|
||||||
|
// so free up the kernel resources for the UID level cgroup.
|
||||||
|
const auto uid_path = ConvertUidToPath(cgroup, uid);
|
||||||
|
ret = rmdir(uid_path.c_str());
|
||||||
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue