android_system_core/libprocessgroup/profiles/task_profiles.json
Siarhei Vishniakou 9ad453ffae Set input thread priority to RT - try 4
This reverts commit 52da71d47b.

Reason for revert: camera was using its own stale copy of libprocessgroup, and now has revved up its version that includes the new parsing code. So this time the json file update should work OK.

Original description:

To improve input latency, set the critical input threads to RT priority.
This will use RT priority on AOSP devices by default. OEMs can still
choose to customize what "input policy" means for their device, which
may not necessarily mean RT.

For example, on device with multiple small / big cores, input task
affinity could be changed to prioritize big cores + higher CPU frequency
/ voltage, but still keep the standard / default input thread priority.

Note: there is an open issue where the thread priority is not remaining constant. See b/378761104.

Bug: 330719044
Bug: 378761104
Flag: com.android.input.flags.enable_input_policy_profile
Test: took perfetto trace and checked the priority on InputDispatcher
and InputReader threads.

Change-Id: I449be0eeeac989222f5deefa62615478bd65b968
2024-11-13 00:56:06 +00:00

723 lines
14 KiB
JSON

{
"Attributes": [
{
"Name": "LowCapacityCPUs",
"Controller": "cpuset",
"File": "background/cpus"
},
{
"Name": "HighCapacityCPUs",
"Controller": "cpuset",
"File": "foreground/cpus"
},
{
"Name": "HighCapacityWICPUs",
"Controller": "cpuset",
"File": "foreground_window/cpus"
},
{
"Name": "MaxCapacityCPUs",
"Controller": "cpuset",
"File": "top-app/cpus"
},
{
"Name": "MemStats",
"Controller": "memory",
"File": "memory.stat"
},
{
"Name": "MemLimit",
"Controller": "memory",
"File": "memory.limit_in_bytes",
"FileV2": "memory.max"
},
{
"Name": "MemSoftLimit",
"Controller": "memory",
"File": "memory.soft_limit_in_bytes",
"FileV2": "memory.low"
},
{
"Name": "MemSwappiness",
"Controller": "memory",
"File": "memory.swappiness"
},
{
"Name": "MemUsage",
"Controller": "memory",
"File": "memory.usage_in_bytes"
},
{
"Name": "MemAndSwapUsage",
"Controller": "memory",
"File": "memory.memsw.usage_in_bytes"
},
{
"Name": "MemPressureLevel",
"Controller": "memory",
"File": "memory.pressure_level"
},
{
"Name": "MemCgroupEventControl",
"Controller": "memory",
"File": "cgroup.event_control"
},
{
"Name": "UClampMin",
"Controller": "cpu",
"File": "cpu.uclamp.min"
},
{
"Name": "UClampMax",
"Controller": "cpu",
"File": "cpu.uclamp.max"
},
{
"Name": "UClampLatencySensitive",
"Controller": "cpu",
"File": "cpu.uclamp.latency_sensitive"
},
{
"Name": "FreezerState",
"Controller": "freezer",
"File": "cgroup.freeze"
}
],
"Profiles": [
{
"Name": "HighEnergySaving",
"Actions": [
{
"Name": "JoinCgroup",
"Params":
{
"Controller": "cpu",
"Path": "background"
}
}
]
},
{
"Name": "Frozen",
"Actions": [
{
"Name": "SetAttribute",
"Params":
{
"Name": "FreezerState",
"Value": "1"
}
}
]
},
{
"Name": "Unfrozen",
"Actions": [
{
"Name": "SetAttribute",
"Params":
{
"Name": "FreezerState",
"Value": "0"
}
}
]
},
{
"Name": "NormalPerformance",
"Actions": [
{
"Name": "JoinCgroup",
"Params":
{
"Controller": "cpu",
"Path": "system"
}
}
]
},
{
"Name": "ServicePerformance",
"Actions": [
{
"Name": "JoinCgroup",
"Params":
{
"Controller": "cpu",
"Path": "system-background"
}
}
]
},
{
"Name": "HighPerformance",
"Actions": [
{
"Name": "JoinCgroup",
"Params":
{
"Controller": "cpu",
"Path": "foreground"
}
}
]
},
{
"Name": "HighPerformanceWI",
"Actions": [
{
"Name": "JoinCgroup",
"Params":
{
"Controller": "cpu",
"Path": "foreground_window"
}
}
]
},
{
"Name": "MaxPerformance",
"Actions": [
{
"Name": "JoinCgroup",
"Params":
{
"Controller": "cpu",
"Path": "top-app"
}
}
]
},
{
"Name": "RealtimePerformance",
"Actions": [
{
"Name": "JoinCgroup",
"Params":
{
"Controller": "cpu",
"Path": "rt"
}
}
]
},
{
"Name": "RealTimeInputScheduling",
"Actions": [
{
"Name": "SetSchedulerPolicy",
"Params":
{
"Policy": "SCHED_FIFO",
"Priority": "2"
}
}
]
},
{
"Name": "CameraServicePerformance",
"Actions": [
{
"Name": "JoinCgroup",
"Params":
{
"Controller": "cpu",
"Path": "camera-daemon"
}
}
]
},
{
"Name": "NNApiHALPerformance",
"Actions": [
{
"Name": "JoinCgroup",
"Params":
{
"Controller": "cpu",
"Path": "nnapi-hal"
}
}
]
},
{
"Name": "Dex2oatPerformance",
"Actions": [
{
"Name": "JoinCgroup",
"Params":
{
"Controller": "cpu",
"Path": "dex2oat"
}
}
]
},
{
"Name": "CpuPolicySpread",
"Actions": [
{
"Name": "SetAttribute",
"Params":
{
"Name": "UClampLatencySensitive",
"Value": "1"
}
}
]
},
{
"Name": "CpuPolicyPack",
"Actions": [
{
"Name": "SetAttribute",
"Params":
{
"Name": "UClampLatencySensitive",
"Value": "0"
}
}
]
},
{
"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": "ProcessCapacityHighWI",
"Actions": [
{
"Name": "JoinCgroup",
"Params":
{
"Controller": "cpuset",
"Path": "foreground_window"
}
}
]
},
{
"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": "SFMainPolicy",
"Actions": [
{
"Name": "JoinCgroup",
"Params":
{
"Controller": "cpuset",
"Path": "system-background"
}
}
]
},
{
"Name": "SFRenderEnginePolicy",
"Actions": [
{
"Name": "JoinCgroup",
"Params":
{
"Controller": "cpuset",
"Path": "system-background"
}
}
]
},
{
"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"
}
}
]
}
],
"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_FOREGROUND_WINDOW",
"Profiles": [ "HighPerformanceWI", "HighIoPriority", "TimerSlackNormal" ]
},
{
"Name": "SCHED_SP_TOP_APP",
"Profiles": [ "MaxPerformance", "MaxIoPriority", "TimerSlackNormal" ]
},
{
"Name": "SCHED_SP_SYSTEM",
"Profiles": [ "ServicePerformance", "LowIoPriority", "TimerSlackNormal" ]
},
{
"Name": "SCHED_SP_COMPUTE",
"Profiles": [ "HighPerformance", "ProcessCapacityHigh", "LowIoPriority", "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_FOREGROUND_WINDOW",
"Profiles": [ "HighPerformanceWI", "ProcessCapacityHighWI", "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" ]
},
{
"Name": "Dex2OatBootComplete",
"Profiles": [ "Dex2oatPerformance", "LowIoPriority", "TimerSlackHigh" ]
},
{
"Name": "Dex2OatBackground",
"Profiles": [ "Dex2OatBootComplete" ]
},
{
"Name": "OtaProfiles",
"Profiles": [ "ServiceCapacityLow", "LowIoPriority", "HighEnergySaving" ]
},
{
"Name": "InputPolicy",
"Profiles": [ "RealTimeInputScheduling", "MaxPerformance", "ProcessCapacityMax", "TimerSlackNormal" ]
}
]
}