Merge "libprocessgroup: Change per-API level task profiles to override the diffs" am: 42fcd76e6c
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1516917
Change-Id: I3534552b33f76126342268af0fa2c5ee9a293c67
diff --git a/libprocessgroup/profiles/cgroups_28.json b/libprocessgroup/profiles/cgroups_28.json
index 4518487..17d4929 100644
--- a/libprocessgroup/profiles/cgroups_28.json
+++ b/libprocessgroup/profiles/cgroups_28.json
@@ -1,59 +1,11 @@
{
"Cgroups": [
{
- "Controller": "blkio",
- "Path": "/dev/blkio",
- "Mode": "0755",
- "UID": "system",
- "GID": "system"
- },
- {
- "Controller": "cpu",
- "Path": "/dev/cpuctl",
- "Mode": "0755",
- "UID": "system",
- "GID": "system"
- },
- {
- "Controller": "cpuacct",
- "Path": "/acct",
- "Mode": "0555"
- },
- {
- "Controller": "cpuset",
- "Path": "/dev/cpuset",
- "Mode": "0755",
- "UID": "system",
- "GID": "system"
- },
- {
- "Controller": "memory",
- "Path": "/dev/memcg",
- "Mode": "0700",
- "UID": "root",
- "GID": "system"
- },
- {
"Controller": "schedtune",
"Path": "/dev/stune",
"Mode": "0755",
"UID": "system",
"GID": "system"
}
- ],
- "Cgroups2": {
- "Path": "/sys/fs/cgroup",
- "Mode": "0755",
- "UID": "system",
- "GID": "system",
- "Controllers": [
- {
- "Controller": "freezer",
- "Path": "freezer",
- "Mode": "0755",
- "UID": "system",
- "GID": "system"
- }
- ]
- }
+ ]
}
diff --git a/libprocessgroup/profiles/cgroups_29.json b/libprocessgroup/profiles/cgroups_29.json
index 4518487..17d4929 100644
--- a/libprocessgroup/profiles/cgroups_29.json
+++ b/libprocessgroup/profiles/cgroups_29.json
@@ -1,59 +1,11 @@
{
"Cgroups": [
{
- "Controller": "blkio",
- "Path": "/dev/blkio",
- "Mode": "0755",
- "UID": "system",
- "GID": "system"
- },
- {
- "Controller": "cpu",
- "Path": "/dev/cpuctl",
- "Mode": "0755",
- "UID": "system",
- "GID": "system"
- },
- {
- "Controller": "cpuacct",
- "Path": "/acct",
- "Mode": "0555"
- },
- {
- "Controller": "cpuset",
- "Path": "/dev/cpuset",
- "Mode": "0755",
- "UID": "system",
- "GID": "system"
- },
- {
- "Controller": "memory",
- "Path": "/dev/memcg",
- "Mode": "0700",
- "UID": "root",
- "GID": "system"
- },
- {
"Controller": "schedtune",
"Path": "/dev/stune",
"Mode": "0755",
"UID": "system",
"GID": "system"
}
- ],
- "Cgroups2": {
- "Path": "/sys/fs/cgroup",
- "Mode": "0755",
- "UID": "system",
- "GID": "system",
- "Controllers": [
- {
- "Controller": "freezer",
- "Path": "freezer",
- "Mode": "0755",
- "UID": "system",
- "GID": "system"
- }
- ]
- }
+ ]
}
diff --git a/libprocessgroup/profiles/cgroups_30.json b/libprocessgroup/profiles/cgroups_30.json
index 4518487..17d4929 100644
--- a/libprocessgroup/profiles/cgroups_30.json
+++ b/libprocessgroup/profiles/cgroups_30.json
@@ -1,59 +1,11 @@
{
"Cgroups": [
{
- "Controller": "blkio",
- "Path": "/dev/blkio",
- "Mode": "0755",
- "UID": "system",
- "GID": "system"
- },
- {
- "Controller": "cpu",
- "Path": "/dev/cpuctl",
- "Mode": "0755",
- "UID": "system",
- "GID": "system"
- },
- {
- "Controller": "cpuacct",
- "Path": "/acct",
- "Mode": "0555"
- },
- {
- "Controller": "cpuset",
- "Path": "/dev/cpuset",
- "Mode": "0755",
- "UID": "system",
- "GID": "system"
- },
- {
- "Controller": "memory",
- "Path": "/dev/memcg",
- "Mode": "0700",
- "UID": "root",
- "GID": "system"
- },
- {
"Controller": "schedtune",
"Path": "/dev/stune",
"Mode": "0755",
"UID": "system",
"GID": "system"
}
- ],
- "Cgroups2": {
- "Path": "/sys/fs/cgroup",
- "Mode": "0755",
- "UID": "system",
- "GID": "system",
- "Controllers": [
- {
- "Controller": "freezer",
- "Path": "freezer",
- "Mode": "0755",
- "UID": "system",
- "GID": "system"
- }
- ]
- }
+ ]
}
diff --git a/libprocessgroup/profiles/task_profiles_28.json b/libprocessgroup/profiles/task_profiles_28.json
index 142b0ba..9f83785 100644
--- a/libprocessgroup/profiles/task_profiles_28.json
+++ b/libprocessgroup/profiles/task_profiles_28.json
@@ -1,36 +1,6 @@
{
"Attributes": [
{
- "Name": "LowCapacityCPUs",
- "Controller": "cpuset",
- "File": "background/cpus"
- },
- {
- "Name": "HighCapacityCPUs",
- "Controller": "cpuset",
- "File": "foreground/cpus"
- },
- {
- "Name": "MaxCapacityCPUs",
- "Controller": "cpuset",
- "File": "top-app/cpus"
- },
- {
- "Name": "MemLimit",
- "Controller": "memory",
- "File": "memory.limit_in_bytes"
- },
- {
- "Name": "MemSoftLimit",
- "Controller": "memory",
- "File": "memory.soft_limit_in_bytes"
- },
- {
- "Name": "MemSwappiness",
- "Controller": "memory",
- "File": "memory.swappiness"
- },
- {
"Name": "STuneBoost",
"Controller": "schedtune",
"File": "schedtune.boost"
@@ -39,21 +9,6 @@
"Name": "STunePreferIdle",
"Controller": "schedtune",
"File": "schedtune.prefer_idle"
- },
- {
- "Name": "UClampMin",
- "Controller": "cpu",
- "File": "cpu.uclamp.min"
- },
- {
- "Name": "UClampMax",
- "Controller": "cpu",
- "File": "cpu.uclamp.max"
- },
- {
- "Name": "FreezerState",
- "Controller": "freezer",
- "File": "cgroup.freeze"
}
],
@@ -72,32 +27,6 @@
]
},
{
- "Name": "Frozen",
- "Actions": [
- {
- "Name": "JoinCgroup",
- "Params":
- {
- "Controller": "freezer",
- "Path": ""
- }
- }
- ]
- },
- {
- "Name": "Unfrozen",
- "Actions": [
- {
- "Name": "JoinCgroup",
- "Params":
- {
- "Controller": "freezer",
- "Path": "../"
- }
- }
- ]
- },
- {
"Name": "NormalPerformance",
"Actions": [
{
@@ -201,427 +130,6 @@
}
}
]
- },
-
- {
- "Name": "VrKernelCapacity",
- "Actions": [
- {
- "Name": "JoinCgroup",
- "Params":
- {
- "Controller": "cpuset",
- "Path": ""
- }
- }
- ]
- },
- {
- "Name": "VrServiceCapacityLow",
- "Actions": [
- {
- "Name": "JoinCgroup",
- "Params":
- {
- "Controller": "cpuset",
- "Path": "system/background"
- }
- }
- ]
- },
- {
- "Name": "VrServiceCapacityNormal",
- "Actions": [
- {
- "Name": "JoinCgroup",
- "Params":
- {
- "Controller": "cpuset",
- "Path": "system"
- }
- }
- ]
- },
- {
- "Name": "VrServiceCapacityHigh",
- "Actions": [
- {
- "Name": "JoinCgroup",
- "Params":
- {
- "Controller": "cpuset",
- "Path": "system/performance"
- }
- }
- ]
- },
- {
- "Name": "VrProcessCapacityLow",
- "Actions": [
- {
- "Name": "JoinCgroup",
- "Params":
- {
- "Controller": "cpuset",
- "Path": "application/background"
- }
- }
- ]
- },
- {
- "Name": "VrProcessCapacityNormal",
- "Actions": [
- {
- "Name": "JoinCgroup",
- "Params":
- {
- "Controller": "cpuset",
- "Path": "application"
- }
- }
- ]
- },
- {
- "Name": "VrProcessCapacityHigh",
- "Actions": [
- {
- "Name": "JoinCgroup",
- "Params":
- {
- "Controller": "cpuset",
- "Path": "application/performance"
- }
- }
- ]
- },
-
- {
- "Name": "ProcessCapacityLow",
- "Actions": [
- {
- "Name": "JoinCgroup",
- "Params":
- {
- "Controller": "cpuset",
- "Path": "background"
- }
- }
- ]
- },
- {
- "Name": "ProcessCapacityNormal",
- "Actions": [
- {
- "Name": "JoinCgroup",
- "Params":
- {
- "Controller": "cpuset",
- "Path": ""
- }
- }
- ]
- },
- {
- "Name": "ProcessCapacityHigh",
- "Actions": [
- {
- "Name": "JoinCgroup",
- "Params":
- {
- "Controller": "cpuset",
- "Path": "foreground"
- }
- }
- ]
- },
- {
- "Name": "ProcessCapacityMax",
- "Actions": [
- {
- "Name": "JoinCgroup",
- "Params":
- {
- "Controller": "cpuset",
- "Path": "top-app"
- }
- }
- ]
- },
-
- {
- "Name": "ServiceCapacityLow",
- "Actions": [
- {
- "Name": "JoinCgroup",
- "Params":
- {
- "Controller": "cpuset",
- "Path": "system-background"
- }
- }
- ]
- },
- {
- "Name": "ServiceCapacityRestricted",
- "Actions": [
- {
- "Name": "JoinCgroup",
- "Params":
- {
- "Controller": "cpuset",
- "Path": "restricted"
- }
- }
- ]
- },
-
- {
- "Name": "CameraServiceCapacity",
- "Actions": [
- {
- "Name": "JoinCgroup",
- "Params":
- {
- "Controller": "cpuset",
- "Path": "camera-daemon"
- }
- }
- ]
- },
-
- {
- "Name": "LowIoPriority",
- "Actions": [
- {
- "Name": "JoinCgroup",
- "Params":
- {
- "Controller": "blkio",
- "Path": "background"
- }
- }
- ]
- },
- {
- "Name": "NormalIoPriority",
- "Actions": [
- {
- "Name": "JoinCgroup",
- "Params":
- {
- "Controller": "blkio",
- "Path": ""
- }
- }
- ]
- },
- {
- "Name": "HighIoPriority",
- "Actions": [
- {
- "Name": "JoinCgroup",
- "Params":
- {
- "Controller": "blkio",
- "Path": ""
- }
- }
- ]
- },
- {
- "Name": "MaxIoPriority",
- "Actions": [
- {
- "Name": "JoinCgroup",
- "Params":
- {
- "Controller": "blkio",
- "Path": ""
- }
- }
- ]
- },
-
- {
- "Name": "TimerSlackHigh",
- "Actions": [
- {
- "Name": "SetTimerSlack",
- "Params":
- {
- "Slack": "40000000"
- }
- }
- ]
- },
- {
- "Name": "TimerSlackNormal",
- "Actions": [
- {
- "Name": "SetTimerSlack",
- "Params":
- {
- "Slack": "50000"
- }
- }
- ]
- },
-
- {
- "Name": "PerfBoost",
- "Actions": [
- {
- "Name": "SetClamps",
- "Params":
- {
- "Boost": "50%",
- "Clamp": "0"
- }
- }
- ]
- },
- {
- "Name": "PerfClamp",
- "Actions": [
- {
- "Name": "SetClamps",
- "Params":
- {
- "Boost": "0",
- "Clamp": "30%"
- }
- }
- ]
- },
-
- {
- "Name": "LowMemoryUsage",
- "Actions": [
- {
- "Name": "SetAttribute",
- "Params":
- {
- "Name": "MemSoftLimit",
- "Value": "16MB"
- }
- },
- {
- "Name": "SetAttribute",
- "Params":
- {
- "Name": "MemSwappiness",
- "Value": "150"
-
- }
- }
- ]
- },
- {
- "Name": "HighMemoryUsage",
- "Actions": [
- {
- "Name": "SetAttribute",
- "Params":
- {
- "Name": "MemSoftLimit",
- "Value": "512MB"
- }
- },
- {
- "Name": "SetAttribute",
- "Params":
- {
- "Name": "MemSwappiness",
- "Value": "100"
- }
- }
- ]
- },
- {
- "Name": "SystemMemoryProcess",
- "Actions": [
- {
- "Name": "JoinCgroup",
- "Params":
- {
- "Controller": "memory",
- "Path": "system"
- }
- }
- ]
- },
- {
- "Name": "FreezerDisabled",
- "Actions": [
- {
- "Name": "SetAttribute",
- "Params":
- {
- "Name": "FreezerState",
- "Value": "0"
- }
- }
- ]
- },
- {
- "Name": "FreezerEnabled",
- "Actions": [
- {
- "Name": "SetAttribute",
- "Params":
- {
- "Name": "FreezerState",
- "Value": "1"
- }
- }
- ]
- }
- ],
-
- "AggregateProfiles": [
- {
- "Name": "SCHED_SP_DEFAULT",
- "Profiles": [ "TimerSlackNormal" ]
- },
- {
- "Name": "SCHED_SP_BACKGROUND",
- "Profiles": [ "HighEnergySaving", "LowIoPriority", "TimerSlackHigh" ]
- },
- {
- "Name": "SCHED_SP_FOREGROUND",
- "Profiles": [ "HighPerformance", "HighIoPriority", "TimerSlackNormal" ]
- },
- {
- "Name": "SCHED_SP_TOP_APP",
- "Profiles": [ "MaxPerformance", "MaxIoPriority", "TimerSlackNormal" ]
- },
- {
- "Name": "SCHED_SP_RT_APP",
- "Profiles": [ "RealtimePerformance", "MaxIoPriority", "TimerSlackNormal" ]
- },
- {
- "Name": "CPUSET_SP_DEFAULT",
- "Profiles": [ "TimerSlackNormal" ]
- },
- {
- "Name": "CPUSET_SP_BACKGROUND",
- "Profiles": [ "HighEnergySaving", "ProcessCapacityLow", "LowIoPriority", "TimerSlackHigh" ]
- },
- {
- "Name": "CPUSET_SP_FOREGROUND",
- "Profiles": [ "HighPerformance", "ProcessCapacityHigh", "HighIoPriority", "TimerSlackNormal" ]
- },
- {
- "Name": "CPUSET_SP_TOP_APP",
- "Profiles": [ "MaxPerformance", "ProcessCapacityMax", "MaxIoPriority", "TimerSlackNormal" ]
- },
- {
- "Name": "CPUSET_SP_SYSTEM",
- "Profiles": [ "ServiceCapacityLow", "TimerSlackNormal" ]
- },
- {
- "Name": "CPUSET_SP_RESTRICTED",
- "Profiles": [ "ServiceCapacityRestricted", "TimerSlackNormal" ]
}
]
}
diff --git a/libprocessgroup/profiles/task_profiles_29.json b/libprocessgroup/profiles/task_profiles_29.json
index 142b0ba..9f83785 100644
--- a/libprocessgroup/profiles/task_profiles_29.json
+++ b/libprocessgroup/profiles/task_profiles_29.json
@@ -1,36 +1,6 @@
{
"Attributes": [
{
- "Name": "LowCapacityCPUs",
- "Controller": "cpuset",
- "File": "background/cpus"
- },
- {
- "Name": "HighCapacityCPUs",
- "Controller": "cpuset",
- "File": "foreground/cpus"
- },
- {
- "Name": "MaxCapacityCPUs",
- "Controller": "cpuset",
- "File": "top-app/cpus"
- },
- {
- "Name": "MemLimit",
- "Controller": "memory",
- "File": "memory.limit_in_bytes"
- },
- {
- "Name": "MemSoftLimit",
- "Controller": "memory",
- "File": "memory.soft_limit_in_bytes"
- },
- {
- "Name": "MemSwappiness",
- "Controller": "memory",
- "File": "memory.swappiness"
- },
- {
"Name": "STuneBoost",
"Controller": "schedtune",
"File": "schedtune.boost"
@@ -39,21 +9,6 @@
"Name": "STunePreferIdle",
"Controller": "schedtune",
"File": "schedtune.prefer_idle"
- },
- {
- "Name": "UClampMin",
- "Controller": "cpu",
- "File": "cpu.uclamp.min"
- },
- {
- "Name": "UClampMax",
- "Controller": "cpu",
- "File": "cpu.uclamp.max"
- },
- {
- "Name": "FreezerState",
- "Controller": "freezer",
- "File": "cgroup.freeze"
}
],
@@ -72,32 +27,6 @@
]
},
{
- "Name": "Frozen",
- "Actions": [
- {
- "Name": "JoinCgroup",
- "Params":
- {
- "Controller": "freezer",
- "Path": ""
- }
- }
- ]
- },
- {
- "Name": "Unfrozen",
- "Actions": [
- {
- "Name": "JoinCgroup",
- "Params":
- {
- "Controller": "freezer",
- "Path": "../"
- }
- }
- ]
- },
- {
"Name": "NormalPerformance",
"Actions": [
{
@@ -201,427 +130,6 @@
}
}
]
- },
-
- {
- "Name": "VrKernelCapacity",
- "Actions": [
- {
- "Name": "JoinCgroup",
- "Params":
- {
- "Controller": "cpuset",
- "Path": ""
- }
- }
- ]
- },
- {
- "Name": "VrServiceCapacityLow",
- "Actions": [
- {
- "Name": "JoinCgroup",
- "Params":
- {
- "Controller": "cpuset",
- "Path": "system/background"
- }
- }
- ]
- },
- {
- "Name": "VrServiceCapacityNormal",
- "Actions": [
- {
- "Name": "JoinCgroup",
- "Params":
- {
- "Controller": "cpuset",
- "Path": "system"
- }
- }
- ]
- },
- {
- "Name": "VrServiceCapacityHigh",
- "Actions": [
- {
- "Name": "JoinCgroup",
- "Params":
- {
- "Controller": "cpuset",
- "Path": "system/performance"
- }
- }
- ]
- },
- {
- "Name": "VrProcessCapacityLow",
- "Actions": [
- {
- "Name": "JoinCgroup",
- "Params":
- {
- "Controller": "cpuset",
- "Path": "application/background"
- }
- }
- ]
- },
- {
- "Name": "VrProcessCapacityNormal",
- "Actions": [
- {
- "Name": "JoinCgroup",
- "Params":
- {
- "Controller": "cpuset",
- "Path": "application"
- }
- }
- ]
- },
- {
- "Name": "VrProcessCapacityHigh",
- "Actions": [
- {
- "Name": "JoinCgroup",
- "Params":
- {
- "Controller": "cpuset",
- "Path": "application/performance"
- }
- }
- ]
- },
-
- {
- "Name": "ProcessCapacityLow",
- "Actions": [
- {
- "Name": "JoinCgroup",
- "Params":
- {
- "Controller": "cpuset",
- "Path": "background"
- }
- }
- ]
- },
- {
- "Name": "ProcessCapacityNormal",
- "Actions": [
- {
- "Name": "JoinCgroup",
- "Params":
- {
- "Controller": "cpuset",
- "Path": ""
- }
- }
- ]
- },
- {
- "Name": "ProcessCapacityHigh",
- "Actions": [
- {
- "Name": "JoinCgroup",
- "Params":
- {
- "Controller": "cpuset",
- "Path": "foreground"
- }
- }
- ]
- },
- {
- "Name": "ProcessCapacityMax",
- "Actions": [
- {
- "Name": "JoinCgroup",
- "Params":
- {
- "Controller": "cpuset",
- "Path": "top-app"
- }
- }
- ]
- },
-
- {
- "Name": "ServiceCapacityLow",
- "Actions": [
- {
- "Name": "JoinCgroup",
- "Params":
- {
- "Controller": "cpuset",
- "Path": "system-background"
- }
- }
- ]
- },
- {
- "Name": "ServiceCapacityRestricted",
- "Actions": [
- {
- "Name": "JoinCgroup",
- "Params":
- {
- "Controller": "cpuset",
- "Path": "restricted"
- }
- }
- ]
- },
-
- {
- "Name": "CameraServiceCapacity",
- "Actions": [
- {
- "Name": "JoinCgroup",
- "Params":
- {
- "Controller": "cpuset",
- "Path": "camera-daemon"
- }
- }
- ]
- },
-
- {
- "Name": "LowIoPriority",
- "Actions": [
- {
- "Name": "JoinCgroup",
- "Params":
- {
- "Controller": "blkio",
- "Path": "background"
- }
- }
- ]
- },
- {
- "Name": "NormalIoPriority",
- "Actions": [
- {
- "Name": "JoinCgroup",
- "Params":
- {
- "Controller": "blkio",
- "Path": ""
- }
- }
- ]
- },
- {
- "Name": "HighIoPriority",
- "Actions": [
- {
- "Name": "JoinCgroup",
- "Params":
- {
- "Controller": "blkio",
- "Path": ""
- }
- }
- ]
- },
- {
- "Name": "MaxIoPriority",
- "Actions": [
- {
- "Name": "JoinCgroup",
- "Params":
- {
- "Controller": "blkio",
- "Path": ""
- }
- }
- ]
- },
-
- {
- "Name": "TimerSlackHigh",
- "Actions": [
- {
- "Name": "SetTimerSlack",
- "Params":
- {
- "Slack": "40000000"
- }
- }
- ]
- },
- {
- "Name": "TimerSlackNormal",
- "Actions": [
- {
- "Name": "SetTimerSlack",
- "Params":
- {
- "Slack": "50000"
- }
- }
- ]
- },
-
- {
- "Name": "PerfBoost",
- "Actions": [
- {
- "Name": "SetClamps",
- "Params":
- {
- "Boost": "50%",
- "Clamp": "0"
- }
- }
- ]
- },
- {
- "Name": "PerfClamp",
- "Actions": [
- {
- "Name": "SetClamps",
- "Params":
- {
- "Boost": "0",
- "Clamp": "30%"
- }
- }
- ]
- },
-
- {
- "Name": "LowMemoryUsage",
- "Actions": [
- {
- "Name": "SetAttribute",
- "Params":
- {
- "Name": "MemSoftLimit",
- "Value": "16MB"
- }
- },
- {
- "Name": "SetAttribute",
- "Params":
- {
- "Name": "MemSwappiness",
- "Value": "150"
-
- }
- }
- ]
- },
- {
- "Name": "HighMemoryUsage",
- "Actions": [
- {
- "Name": "SetAttribute",
- "Params":
- {
- "Name": "MemSoftLimit",
- "Value": "512MB"
- }
- },
- {
- "Name": "SetAttribute",
- "Params":
- {
- "Name": "MemSwappiness",
- "Value": "100"
- }
- }
- ]
- },
- {
- "Name": "SystemMemoryProcess",
- "Actions": [
- {
- "Name": "JoinCgroup",
- "Params":
- {
- "Controller": "memory",
- "Path": "system"
- }
- }
- ]
- },
- {
- "Name": "FreezerDisabled",
- "Actions": [
- {
- "Name": "SetAttribute",
- "Params":
- {
- "Name": "FreezerState",
- "Value": "0"
- }
- }
- ]
- },
- {
- "Name": "FreezerEnabled",
- "Actions": [
- {
- "Name": "SetAttribute",
- "Params":
- {
- "Name": "FreezerState",
- "Value": "1"
- }
- }
- ]
- }
- ],
-
- "AggregateProfiles": [
- {
- "Name": "SCHED_SP_DEFAULT",
- "Profiles": [ "TimerSlackNormal" ]
- },
- {
- "Name": "SCHED_SP_BACKGROUND",
- "Profiles": [ "HighEnergySaving", "LowIoPriority", "TimerSlackHigh" ]
- },
- {
- "Name": "SCHED_SP_FOREGROUND",
- "Profiles": [ "HighPerformance", "HighIoPriority", "TimerSlackNormal" ]
- },
- {
- "Name": "SCHED_SP_TOP_APP",
- "Profiles": [ "MaxPerformance", "MaxIoPriority", "TimerSlackNormal" ]
- },
- {
- "Name": "SCHED_SP_RT_APP",
- "Profiles": [ "RealtimePerformance", "MaxIoPriority", "TimerSlackNormal" ]
- },
- {
- "Name": "CPUSET_SP_DEFAULT",
- "Profiles": [ "TimerSlackNormal" ]
- },
- {
- "Name": "CPUSET_SP_BACKGROUND",
- "Profiles": [ "HighEnergySaving", "ProcessCapacityLow", "LowIoPriority", "TimerSlackHigh" ]
- },
- {
- "Name": "CPUSET_SP_FOREGROUND",
- "Profiles": [ "HighPerformance", "ProcessCapacityHigh", "HighIoPriority", "TimerSlackNormal" ]
- },
- {
- "Name": "CPUSET_SP_TOP_APP",
- "Profiles": [ "MaxPerformance", "ProcessCapacityMax", "MaxIoPriority", "TimerSlackNormal" ]
- },
- {
- "Name": "CPUSET_SP_SYSTEM",
- "Profiles": [ "ServiceCapacityLow", "TimerSlackNormal" ]
- },
- {
- "Name": "CPUSET_SP_RESTRICTED",
- "Profiles": [ "ServiceCapacityRestricted", "TimerSlackNormal" ]
}
]
}
diff --git a/libprocessgroup/profiles/task_profiles_30.json b/libprocessgroup/profiles/task_profiles_30.json
index 142b0ba..9f83785 100644
--- a/libprocessgroup/profiles/task_profiles_30.json
+++ b/libprocessgroup/profiles/task_profiles_30.json
@@ -1,36 +1,6 @@
{
"Attributes": [
{
- "Name": "LowCapacityCPUs",
- "Controller": "cpuset",
- "File": "background/cpus"
- },
- {
- "Name": "HighCapacityCPUs",
- "Controller": "cpuset",
- "File": "foreground/cpus"
- },
- {
- "Name": "MaxCapacityCPUs",
- "Controller": "cpuset",
- "File": "top-app/cpus"
- },
- {
- "Name": "MemLimit",
- "Controller": "memory",
- "File": "memory.limit_in_bytes"
- },
- {
- "Name": "MemSoftLimit",
- "Controller": "memory",
- "File": "memory.soft_limit_in_bytes"
- },
- {
- "Name": "MemSwappiness",
- "Controller": "memory",
- "File": "memory.swappiness"
- },
- {
"Name": "STuneBoost",
"Controller": "schedtune",
"File": "schedtune.boost"
@@ -39,21 +9,6 @@
"Name": "STunePreferIdle",
"Controller": "schedtune",
"File": "schedtune.prefer_idle"
- },
- {
- "Name": "UClampMin",
- "Controller": "cpu",
- "File": "cpu.uclamp.min"
- },
- {
- "Name": "UClampMax",
- "Controller": "cpu",
- "File": "cpu.uclamp.max"
- },
- {
- "Name": "FreezerState",
- "Controller": "freezer",
- "File": "cgroup.freeze"
}
],
@@ -72,32 +27,6 @@
]
},
{
- "Name": "Frozen",
- "Actions": [
- {
- "Name": "JoinCgroup",
- "Params":
- {
- "Controller": "freezer",
- "Path": ""
- }
- }
- ]
- },
- {
- "Name": "Unfrozen",
- "Actions": [
- {
- "Name": "JoinCgroup",
- "Params":
- {
- "Controller": "freezer",
- "Path": "../"
- }
- }
- ]
- },
- {
"Name": "NormalPerformance",
"Actions": [
{
@@ -201,427 +130,6 @@
}
}
]
- },
-
- {
- "Name": "VrKernelCapacity",
- "Actions": [
- {
- "Name": "JoinCgroup",
- "Params":
- {
- "Controller": "cpuset",
- "Path": ""
- }
- }
- ]
- },
- {
- "Name": "VrServiceCapacityLow",
- "Actions": [
- {
- "Name": "JoinCgroup",
- "Params":
- {
- "Controller": "cpuset",
- "Path": "system/background"
- }
- }
- ]
- },
- {
- "Name": "VrServiceCapacityNormal",
- "Actions": [
- {
- "Name": "JoinCgroup",
- "Params":
- {
- "Controller": "cpuset",
- "Path": "system"
- }
- }
- ]
- },
- {
- "Name": "VrServiceCapacityHigh",
- "Actions": [
- {
- "Name": "JoinCgroup",
- "Params":
- {
- "Controller": "cpuset",
- "Path": "system/performance"
- }
- }
- ]
- },
- {
- "Name": "VrProcessCapacityLow",
- "Actions": [
- {
- "Name": "JoinCgroup",
- "Params":
- {
- "Controller": "cpuset",
- "Path": "application/background"
- }
- }
- ]
- },
- {
- "Name": "VrProcessCapacityNormal",
- "Actions": [
- {
- "Name": "JoinCgroup",
- "Params":
- {
- "Controller": "cpuset",
- "Path": "application"
- }
- }
- ]
- },
- {
- "Name": "VrProcessCapacityHigh",
- "Actions": [
- {
- "Name": "JoinCgroup",
- "Params":
- {
- "Controller": "cpuset",
- "Path": "application/performance"
- }
- }
- ]
- },
-
- {
- "Name": "ProcessCapacityLow",
- "Actions": [
- {
- "Name": "JoinCgroup",
- "Params":
- {
- "Controller": "cpuset",
- "Path": "background"
- }
- }
- ]
- },
- {
- "Name": "ProcessCapacityNormal",
- "Actions": [
- {
- "Name": "JoinCgroup",
- "Params":
- {
- "Controller": "cpuset",
- "Path": ""
- }
- }
- ]
- },
- {
- "Name": "ProcessCapacityHigh",
- "Actions": [
- {
- "Name": "JoinCgroup",
- "Params":
- {
- "Controller": "cpuset",
- "Path": "foreground"
- }
- }
- ]
- },
- {
- "Name": "ProcessCapacityMax",
- "Actions": [
- {
- "Name": "JoinCgroup",
- "Params":
- {
- "Controller": "cpuset",
- "Path": "top-app"
- }
- }
- ]
- },
-
- {
- "Name": "ServiceCapacityLow",
- "Actions": [
- {
- "Name": "JoinCgroup",
- "Params":
- {
- "Controller": "cpuset",
- "Path": "system-background"
- }
- }
- ]
- },
- {
- "Name": "ServiceCapacityRestricted",
- "Actions": [
- {
- "Name": "JoinCgroup",
- "Params":
- {
- "Controller": "cpuset",
- "Path": "restricted"
- }
- }
- ]
- },
-
- {
- "Name": "CameraServiceCapacity",
- "Actions": [
- {
- "Name": "JoinCgroup",
- "Params":
- {
- "Controller": "cpuset",
- "Path": "camera-daemon"
- }
- }
- ]
- },
-
- {
- "Name": "LowIoPriority",
- "Actions": [
- {
- "Name": "JoinCgroup",
- "Params":
- {
- "Controller": "blkio",
- "Path": "background"
- }
- }
- ]
- },
- {
- "Name": "NormalIoPriority",
- "Actions": [
- {
- "Name": "JoinCgroup",
- "Params":
- {
- "Controller": "blkio",
- "Path": ""
- }
- }
- ]
- },
- {
- "Name": "HighIoPriority",
- "Actions": [
- {
- "Name": "JoinCgroup",
- "Params":
- {
- "Controller": "blkio",
- "Path": ""
- }
- }
- ]
- },
- {
- "Name": "MaxIoPriority",
- "Actions": [
- {
- "Name": "JoinCgroup",
- "Params":
- {
- "Controller": "blkio",
- "Path": ""
- }
- }
- ]
- },
-
- {
- "Name": "TimerSlackHigh",
- "Actions": [
- {
- "Name": "SetTimerSlack",
- "Params":
- {
- "Slack": "40000000"
- }
- }
- ]
- },
- {
- "Name": "TimerSlackNormal",
- "Actions": [
- {
- "Name": "SetTimerSlack",
- "Params":
- {
- "Slack": "50000"
- }
- }
- ]
- },
-
- {
- "Name": "PerfBoost",
- "Actions": [
- {
- "Name": "SetClamps",
- "Params":
- {
- "Boost": "50%",
- "Clamp": "0"
- }
- }
- ]
- },
- {
- "Name": "PerfClamp",
- "Actions": [
- {
- "Name": "SetClamps",
- "Params":
- {
- "Boost": "0",
- "Clamp": "30%"
- }
- }
- ]
- },
-
- {
- "Name": "LowMemoryUsage",
- "Actions": [
- {
- "Name": "SetAttribute",
- "Params":
- {
- "Name": "MemSoftLimit",
- "Value": "16MB"
- }
- },
- {
- "Name": "SetAttribute",
- "Params":
- {
- "Name": "MemSwappiness",
- "Value": "150"
-
- }
- }
- ]
- },
- {
- "Name": "HighMemoryUsage",
- "Actions": [
- {
- "Name": "SetAttribute",
- "Params":
- {
- "Name": "MemSoftLimit",
- "Value": "512MB"
- }
- },
- {
- "Name": "SetAttribute",
- "Params":
- {
- "Name": "MemSwappiness",
- "Value": "100"
- }
- }
- ]
- },
- {
- "Name": "SystemMemoryProcess",
- "Actions": [
- {
- "Name": "JoinCgroup",
- "Params":
- {
- "Controller": "memory",
- "Path": "system"
- }
- }
- ]
- },
- {
- "Name": "FreezerDisabled",
- "Actions": [
- {
- "Name": "SetAttribute",
- "Params":
- {
- "Name": "FreezerState",
- "Value": "0"
- }
- }
- ]
- },
- {
- "Name": "FreezerEnabled",
- "Actions": [
- {
- "Name": "SetAttribute",
- "Params":
- {
- "Name": "FreezerState",
- "Value": "1"
- }
- }
- ]
- }
- ],
-
- "AggregateProfiles": [
- {
- "Name": "SCHED_SP_DEFAULT",
- "Profiles": [ "TimerSlackNormal" ]
- },
- {
- "Name": "SCHED_SP_BACKGROUND",
- "Profiles": [ "HighEnergySaving", "LowIoPriority", "TimerSlackHigh" ]
- },
- {
- "Name": "SCHED_SP_FOREGROUND",
- "Profiles": [ "HighPerformance", "HighIoPriority", "TimerSlackNormal" ]
- },
- {
- "Name": "SCHED_SP_TOP_APP",
- "Profiles": [ "MaxPerformance", "MaxIoPriority", "TimerSlackNormal" ]
- },
- {
- "Name": "SCHED_SP_RT_APP",
- "Profiles": [ "RealtimePerformance", "MaxIoPriority", "TimerSlackNormal" ]
- },
- {
- "Name": "CPUSET_SP_DEFAULT",
- "Profiles": [ "TimerSlackNormal" ]
- },
- {
- "Name": "CPUSET_SP_BACKGROUND",
- "Profiles": [ "HighEnergySaving", "ProcessCapacityLow", "LowIoPriority", "TimerSlackHigh" ]
- },
- {
- "Name": "CPUSET_SP_FOREGROUND",
- "Profiles": [ "HighPerformance", "ProcessCapacityHigh", "HighIoPriority", "TimerSlackNormal" ]
- },
- {
- "Name": "CPUSET_SP_TOP_APP",
- "Profiles": [ "MaxPerformance", "ProcessCapacityMax", "MaxIoPriority", "TimerSlackNormal" ]
- },
- {
- "Name": "CPUSET_SP_SYSTEM",
- "Profiles": [ "ServiceCapacityLow", "TimerSlackNormal" ]
- },
- {
- "Name": "CPUSET_SP_RESTRICTED",
- "Profiles": [ "ServiceCapacityRestricted", "TimerSlackNormal" ]
}
]
}
diff --git a/libprocessgroup/setup/cgroup_map_write.cpp b/libprocessgroup/setup/cgroup_map_write.cpp
index a53132e..753fd2d 100644
--- a/libprocessgroup/setup/cgroup_map_write.cpp
+++ b/libprocessgroup/setup/cgroup_map_write.cpp
@@ -214,23 +214,23 @@
}
static bool ReadDescriptors(std::map<std::string, CgroupDescriptor>* descriptors) {
- unsigned int api_level = GetUintProperty<unsigned int>("ro.product.first_api_level", 0);
- std::string sys_cgroups_path = CGROUPS_DESC_FILE;
+ // load system cgroup descriptors
+ if (!ReadDescriptorsFromFile(CGROUPS_DESC_FILE, descriptors)) {
+ return false;
+ }
// load API-level specific system cgroups descriptors if available
+ unsigned int api_level = GetUintProperty<unsigned int>("ro.product.first_api_level", 0);
if (api_level > 0) {
std::string api_cgroups_path =
android::base::StringPrintf(TEMPLATE_CGROUPS_DESC_API_FILE, api_level);
if (!access(api_cgroups_path.c_str(), F_OK) || errno != ENOENT) {
- sys_cgroups_path = api_cgroups_path;
+ if (!ReadDescriptorsFromFile(api_cgroups_path, descriptors)) {
+ return false;
+ }
}
}
- // load system cgroup descriptors
- if (!ReadDescriptorsFromFile(sys_cgroups_path, descriptors)) {
- return false;
- }
-
// load vendor cgroup descriptors if the file exists
if (!access(CGROUPS_DESC_VENDOR_FILE, F_OK) &&
!ReadDescriptorsFromFile(CGROUPS_DESC_VENDOR_FILE, descriptors)) {
diff --git a/libprocessgroup/task_profiles.cpp b/libprocessgroup/task_profiles.cpp
index db44228..1311306 100644
--- a/libprocessgroup/task_profiles.cpp
+++ b/libprocessgroup/task_profiles.cpp
@@ -391,23 +391,24 @@
}
TaskProfiles::TaskProfiles() {
- unsigned int api_level = GetUintProperty<unsigned int>("ro.product.first_api_level", 0);
- std::string sys_profiles_path = TASK_PROFILE_DB_FILE;
+ // load system task profiles
+ if (!Load(CgroupMap::GetInstance(), TASK_PROFILE_DB_FILE)) {
+ LOG(ERROR) << "Loading " << TASK_PROFILE_DB_FILE << " for [" << getpid() << "] failed";
+ }
// load API-level specific system task profiles if available
+ unsigned int api_level = GetUintProperty<unsigned int>("ro.product.first_api_level", 0);
if (api_level > 0) {
std::string api_profiles_path =
android::base::StringPrintf(TEMPLATE_TASK_PROFILE_API_FILE, api_level);
if (!access(api_profiles_path.c_str(), F_OK) || errno != ENOENT) {
- sys_profiles_path = api_profiles_path;
+ if (!Load(CgroupMap::GetInstance(), api_profiles_path)) {
+ LOG(ERROR) << "Loading " << api_profiles_path << " for [" << getpid()
+ << "] failed";
+ }
}
}
- // load system task profiles
- if (!Load(CgroupMap::GetInstance(), sys_profiles_path)) {
- LOG(ERROR) << "Loading " << sys_profiles_path << " for [" << getpid() << "] failed";
- }
-
// load vendor task profiles if the file exists
if (!access(TASK_PROFILE_DB_VENDOR_FILE, F_OK) &&
!Load(CgroupMap::GetInstance(), TASK_PROFILE_DB_VENDOR_FILE)) {