Merge changes from topic "aosp_use_uclamp"

* changes:
  init: Add cpu controller hierarchy to use utilclamp controller
  libprocessgroup: Replace stune with utilclamp profiles
This commit is contained in:
Rick Yiu 2020-10-30 07:12:32 +00:00 committed by Gerrit Code Review
commit 32809d8231
3 changed files with 55 additions and 25 deletions

View file

@ -32,13 +32,6 @@
"Mode": "0700",
"UID": "root",
"GID": "system"
},
{
"Controller": "schedtune",
"Path": "/dev/stune",
"Mode": "0755",
"UID": "system",
"GID": "system"
}
],
"Cgroups2": {

View file

@ -30,16 +30,6 @@
"Controller": "memory",
"File": "memory.swappiness"
},
{
"Name": "STuneBoost",
"Controller": "schedtune",
"File": "schedtune.boost"
},
{
"Name": "STunePreferIdle",
"Controller": "schedtune",
"File": "schedtune.prefer_idle"
},
{
"Name": "UClampMin",
"Controller": "cpu",
@ -50,6 +40,11 @@
"Controller": "cpu",
"File": "cpu.uclamp.max"
},
{
"Name": "UClampLatencySensitive",
"Controller": "cpu",
"File": "cpu.uclamp.latency_sensitive"
},
{
"Name": "FreezerState",
"Controller": "freezer",
@ -65,7 +60,7 @@
"Name": "JoinCgroup",
"Params":
{
"Controller": "schedtune",
"Controller": "cpu",
"Path": "background"
}
}
@ -104,7 +99,7 @@
"Name": "JoinCgroup",
"Params":
{
"Controller": "schedtune",
"Controller": "cpu",
"Path": ""
}
}
@ -117,7 +112,7 @@
"Name": "JoinCgroup",
"Params":
{
"Controller": "schedtune",
"Controller": "cpu",
"Path": "foreground"
}
}
@ -130,7 +125,7 @@
"Name": "JoinCgroup",
"Params":
{
"Controller": "schedtune",
"Controller": "cpu",
"Path": "top-app"
}
}
@ -143,7 +138,7 @@
"Name": "JoinCgroup",
"Params":
{
"Controller": "schedtune",
"Controller": "cpu",
"Path": "rt"
}
}
@ -156,12 +151,25 @@
"Name": "JoinCgroup",
"Params":
{
"Controller": "schedtune",
"Controller": "cpu",
"Path": "camera-daemon"
}
}
]
},
{
"Name": "NNApiHALPerformance",
"Actions": [
{
"Name": "JoinCgroup",
"Params":
{
"Controller": "cpu",
"Path": "nnapi-hal"
}
}
]
},
{
"Name": "CpuPolicySpread",
@ -170,7 +178,7 @@
"Name": "SetAttribute",
"Params":
{
"Name": "STunePreferIdle",
"Name": "UClampLatencySensitive",
"Value": "1"
}
}
@ -183,7 +191,7 @@
"Name": "SetAttribute",
"Params":
{
"Name": "STunePreferIdle",
"Name": "UClampLatencySensitive",
"Value": "0"
}
}

View file

@ -148,6 +148,27 @@ on init
chmod 0664 /dev/stune/top-app/tasks
chmod 0664 /dev/stune/rt/tasks
# cpuctl hierarchy for devices using utilclamp
mkdir /dev/cpuctl/foreground
mkdir /dev/cpuctl/background
mkdir /dev/cpuctl/top-app
mkdir /dev/cpuctl/rt
chown system system /dev/cpuctl
chown system system /dev/cpuctl/foreground
chown system system /dev/cpuctl/background
chown system system /dev/cpuctl/top-app
chown system system /dev/cpuctl/rt
chown system system /dev/cpuctl/tasks
chown system system /dev/cpuctl/foreground/tasks
chown system system /dev/cpuctl/background/tasks
chown system system /dev/cpuctl/top-app/tasks
chown system system /dev/cpuctl/rt/tasks
chmod 0664 /dev/cpuctl/tasks
chmod 0664 /dev/cpuctl/foreground/tasks
chmod 0664 /dev/cpuctl/background/tasks
chmod 0664 /dev/cpuctl/top-app/tasks
chmod 0664 /dev/cpuctl/rt/tasks
# Create an stune group for NNAPI HAL processes
mkdir /dev/stune/nnapi-hal
chown system system /dev/stune/nnapi-hal
@ -156,6 +177,14 @@ on init
write /dev/stune/nnapi-hal/schedtune.boost 1
write /dev/stune/nnapi-hal/schedtune.prefer_idle 1
# cpuctl hierarchy for devices using utilclamp
mkdir /dev/cpuctl/nnapi-hal
chown system system /dev/cpuctl/nnapi-hal
chown system system /dev/cpuctl/nnapi-hal/tasks
chmod 0664 /dev/cpuctl/nnapi-hal/tasks
write /dev/cpuctl/nnapi-hal/cpu.uclamp.min 1
write /dev/cpuctl/nnapi-hal/cpu.uclamp.latency_sensitive 1
# Create blkio group and apply initial settings.
# This feature needs kernel to support it, and the
# device's init.rc must actually set the correct values.