-
Notifications
You must be signed in to change notification settings - Fork 36
/
0041-Ignore-cgroup-creation-errors.patch
50 lines (46 loc) · 2.51 KB
/
0041-Ignore-cgroup-creation-errors.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
From 2b6e41766dc946720a33a832bb4cfe59e9c1adfa Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Wed, 18 Oct 2023 16:53:40 -0400
Subject: [PATCH 41/46] Ignore cgroup creation errors
For old kernels who don't have those modern cgroups
---
core/jni/com_android_internal_os_Zygote.cpp | 2 ++
services/core/java/com/android/server/am/ProcessList.java | 5 -----
2 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/core/jni/com_android_internal_os_Zygote.cpp b/core/jni/com_android_internal_os_Zygote.cpp
index 56066b2d813c..4ee3e92910d0 100644
--- a/core/jni/com_android_internal_os_Zygote.cpp
+++ b/core/jni/com_android_internal_os_Zygote.cpp
@@ -1806,10 +1806,12 @@ static void SpecializeCommon(JNIEnv* env, uid_t uid, gid_t gid, jintArray gids,
if (!is_system_server && getuid() == 0) {
const int rc = createProcessGroup(uid, getpid());
if (rc != 0) {
+#if 0
fail_fn(rc == -EROFS ? CREATE_ERROR("createProcessGroup failed, kernel missing "
"CONFIG_CGROUP_CPUACCT?")
: CREATE_ERROR("createProcessGroup(%d, %d) failed: %s", uid,
/* pid= */ 0, strerror(-rc)));
+#endif
}
}
diff --git a/services/core/java/com/android/server/am/ProcessList.java b/services/core/java/com/android/server/am/ProcessList.java
index b0f77604319b..23ca22fc73f4 100644
--- a/services/core/java/com/android/server/am/ProcessList.java
+++ b/services/core/java/com/android/server/am/ProcessList.java
@@ -2433,14 +2433,9 @@ public final class ProcessList {
// If we're not told to skip the process group creation, go create it.
final int res = Process.createProcessGroup(uid, startResult.pid);
if (res < 0) {
- if (res == -OsConstants.ESRCH) {
Slog.e(ActivityManagerService.TAG,
"Unable to create process group for "
+ app.processName + " (" + startResult.pid + ")");
- } else {
- throw new AssertionError("Unable to create process group for "
- + app.processName + " (" + startResult.pid + ")");
- }
} else {
app.mProcessGroupCreated = true;
}
--
2.34.1