@@ -153,21 +153,56 @@ on init
153
153
mkdir /dev/cpuctl/background
154
154
mkdir /dev/cpuctl/top-app
155
155
mkdir /dev/cpuctl/rt
156
+ mkdir /dev/cpuctl/system
156
157
chown system system /dev/cpuctl
157
158
chown system system /dev/cpuctl/foreground
158
159
chown system system /dev/cpuctl/background
159
160
chown system system /dev/cpuctl/top-app
160
161
chown system system /dev/cpuctl/rt
162
+ chown system system /dev/cpuctl/system
161
163
chown system system /dev/cpuctl/tasks
162
164
chown system system /dev/cpuctl/foreground/tasks
163
165
chown system system /dev/cpuctl/background/tasks
164
166
chown system system /dev/cpuctl/top-app/tasks
165
167
chown system system /dev/cpuctl/rt/tasks
168
+ chown system system /dev/cpuctl/system/tasks
166
169
chmod 0664 /dev/cpuctl/tasks
167
170
chmod 0664 /dev/cpuctl/foreground/tasks
168
171
chmod 0664 /dev/cpuctl/background/tasks
169
172
chmod 0664 /dev/cpuctl/top-app/tasks
170
173
chmod 0664 /dev/cpuctl/rt/tasks
174
+ chmod 0664 /dev/cpuctl/system/tasks
175
+
176
+ # Create a cpu group for NNAPI HAL processes
177
+ mkdir /dev/cpuctl/nnapi-hal
178
+ chown system system /dev/cpuctl/nnapi-hal
179
+ chown system system /dev/cpuctl/nnapi-hal/tasks
180
+ chmod 0664 /dev/cpuctl/nnapi-hal/tasks
181
+ write /dev/cpuctl/nnapi-hal/cpu.uclamp.min 1
182
+ write /dev/cpuctl/nnapi-hal/cpu.uclamp.latency_sensitive 1
183
+
184
+ # Android only use global RT throttling and doesn't use CONFIG_RT_GROUP_SCHED
185
+ # for RT group throttling. These values here are just to make sure RT threads
186
+ # can be migrated to those groups. These settings can be removed once we migrate
187
+ # to GKI kernel.
188
+ write /dev/cpuctl/cpu.rt_period_us 1000000
189
+ write /dev/cpuctl/cpu.rt_runtime_us 950000
190
+ # Surfaceflinger is in FG group so giving it a bit more
191
+ write /dev/cpuctl/foreground/cpu.rt_runtime_us 450000
192
+ write /dev/cpuctl/foreground/cpu.rt_period_us 1000000
193
+ write /dev/cpuctl/background/cpu.rt_runtime_us 100000
194
+ write /dev/cpuctl/background/cpu.rt_period_us 1000000
195
+ write /dev/cpuctl/top-app/cpu.rt_runtime_us 100000
196
+ write /dev/cpuctl/top-app/cpu.rt_period_us 1000000
197
+ write /dev/cpuctl/rt/cpu.rt_runtime_us 100000
198
+ write /dev/cpuctl/rt/cpu.rt_period_us 1000000
199
+ write /dev/cpuctl/system/cpu.rt_runtime_us 100000
200
+ write /dev/cpuctl/system/cpu.rt_period_us 1000000
201
+ write /dev/cpuctl/nnapi-hal/cpu.rt_runtime_us 100000
202
+ write /dev/cpuctl/nnapi-hal/cpu.rt_period_us 1000000
203
+
204
+ # Migrate root group to system subgroup
205
+ copy_per_line /dev/cpuctl/tasks /dev/cpuctl/system/tasks
171
206
172
207
# Create an stune group for NNAPI HAL processes
173
208
mkdir /dev/stune/nnapi-hal
@@ -177,14 +212,6 @@ on init
177
212
write /dev/stune/nnapi-hal/schedtune.boost 1
178
213
write /dev/stune/nnapi-hal/schedtune.prefer_idle 1
179
214
180
- # cpuctl hierarchy for devices using utilclamp
181
- mkdir /dev/cpuctl/nnapi-hal
182
- chown system system /dev/cpuctl/nnapi-hal
183
- chown system system /dev/cpuctl/nnapi-hal/tasks
184
- chmod 0664 /dev/cpuctl/nnapi-hal/tasks
185
- write /dev/cpuctl/nnapi-hal/cpu.uclamp.min 1
186
- write /dev/cpuctl/nnapi-hal/cpu.uclamp.latency_sensitive 1
187
-
188
215
# Create blkio group and apply initial settings.
189
216
# This feature needs kernel to support it, and the
190
217
# device's init.rc must actually set the correct values.
@@ -302,8 +329,6 @@ on init
302
329
chown system system /dev/cpuctl
303
330
chown system system /dev/cpuctl/tasks
304
331
chmod 0666 /dev/cpuctl/tasks
305
- write /dev/cpuctl/cpu.rt_period_us 1000000
306
- write /dev/cpuctl/cpu.rt_runtime_us 950000
307
332
308
333
# sets up initial cpusets for ActivityManager
309
334
# this ensures that the cpusets are present and usable, but the device's
@@ -1151,3 +1176,7 @@ on userspace-reboot-resume
1151
1176
1152
1177
on property:sys.boot_completed=1 && property:sys.init.userspace_reboot.in_progress=1
1153
1178
setprop sys.init.userspace_reboot.in_progress ""
1179
+
1180
+ # Migrate tasks again in case kernel threads are created during boot
1181
+ on property:sys.boot_completed=1
1182
+ copy_per_line /dev/cpuctl/tasks /dev/cpuctl/system/tasks
0 commit comments