Loading libprocessgroup/profiles/cgroups.json +7 −0 Original line number Original line Diff line number Diff line { { "Cgroups": [ "Cgroups": [ { "Controller": "blkio", "Path": "/dev/blkio", "Mode": "0755", "UID": "system", "GID": "system" }, { { "Controller": "cpu", "Controller": "cpu", "Path": "/dev/cpuctl", "Path": "/dev/cpuctl", Loading libprocessgroup/profiles/task_profiles.json +53 −0 Original line number Original line Diff line number Diff line Loading @@ -333,6 +333,59 @@ ] ] }, }, { "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", "Name": "TimerSlackHigh", "Actions" : [ "Actions" : [ Loading libprocessgroup/sched_policy.cpp +19 −10 Original line number Original line Diff line number Diff line Loading @@ -46,20 +46,20 @@ int set_cpuset_policy(int tid, SchedPolicy policy) { switch (policy) { switch (policy) { case SP_BACKGROUND: case SP_BACKGROUND: return SetTaskProfiles(tid, return SetTaskProfiles(tid, {"HighEnergySaving", "ProcessCapacityLow", "LowIoPriority", {"HighEnergySaving", "ProcessCapacityLow", "TimerSlackHigh"}) "TimerSlackHigh"}) ? 0 ? 0 : -1; : -1; case SP_FOREGROUND: case SP_FOREGROUND: case SP_AUDIO_APP: case SP_AUDIO_APP: case SP_AUDIO_SYS: case SP_AUDIO_SYS: return SetTaskProfiles(tid, return SetTaskProfiles(tid, {"HighPerformance", "ProcessCapacityHigh", "HighIoPriority", {"HighPerformance", "ProcessCapacityHigh", "TimerSlackNormal"}) "TimerSlackNormal"}) ? 0 ? 0 : -1; : -1; case SP_TOP_APP: case SP_TOP_APP: return SetTaskProfiles(tid, return SetTaskProfiles(tid, {"MaxPerformance", "ProcessCapacityMax", "MaxIoPriority", {"MaxPerformance", "ProcessCapacityMax", "TimerSlackNormal"}) "TimerSlackNormal"}) ? 0 ? 0 : -1; : -1; case SP_SYSTEM: case SP_SYSTEM: Loading Loading @@ -126,15 +126,24 @@ int set_sched_policy(int tid, SchedPolicy policy) { switch (policy) { switch (policy) { case SP_BACKGROUND: case SP_BACKGROUND: return SetTaskProfiles(tid, {"HighEnergySaving", "TimerSlackHigh"}) ? 0 : -1; return SetTaskProfiles(tid, {"HighEnergySaving", "LowIoPriority", "TimerSlackHigh"}) ? 0 : -1; case SP_FOREGROUND: case SP_FOREGROUND: case SP_AUDIO_APP: case SP_AUDIO_APP: case SP_AUDIO_SYS: case SP_AUDIO_SYS: return SetTaskProfiles(tid, {"HighPerformance", "TimerSlackNormal"}) ? 0 : -1; return SetTaskProfiles(tid, {"HighPerformance", "HighIoPriority", "TimerSlackNormal"}) ? 0 : -1; case SP_TOP_APP: case SP_TOP_APP: return SetTaskProfiles(tid, {"MaxPerformance", "TimerSlackNormal"}) ? 0 : -1; return SetTaskProfiles(tid, {"MaxPerformance", "MaxIoPriority", "TimerSlackNormal"}) ? 0 : -1; case SP_RT_APP: case SP_RT_APP: return SetTaskProfiles(tid, {"RealtimePerformance", "TimerSlackNormal"}) ? 0 : -1; return SetTaskProfiles(tid, {"RealtimePerformance", "MaxIoPriority", "TimerSlackNormal"}) ? 0 : -1; default: default: return SetTaskProfiles(tid, {"TimerSlackNormal"}) ? 0 : -1; return SetTaskProfiles(tid, {"TimerSlackNormal"}) ? 0 : -1; } } Loading rootdir/init.rc +9 −0 Original line number Original line Diff line number Diff line Loading @@ -84,6 +84,15 @@ on init chmod 0664 /dev/stune/top-app/tasks chmod 0664 /dev/stune/top-app/tasks chmod 0664 /dev/stune/rt/tasks chmod 0664 /dev/stune/rt/tasks # Create blkio tuning nodes mkdir /dev/blkio/background chown system system /dev/blkio chown system system /dev/blkio/background chown system system /dev/blkio/tasks chown system system /dev/blkio/background/tasks chmod 0664 /dev/blkio/tasks chmod 0664 /dev/blkio/background/tasks restorecon_recursive /mnt restorecon_recursive /mnt mount configfs none /config nodev noexec nosuid mount configfs none /config nodev noexec nosuid Loading Loading
libprocessgroup/profiles/cgroups.json +7 −0 Original line number Original line Diff line number Diff line { { "Cgroups": [ "Cgroups": [ { "Controller": "blkio", "Path": "/dev/blkio", "Mode": "0755", "UID": "system", "GID": "system" }, { { "Controller": "cpu", "Controller": "cpu", "Path": "/dev/cpuctl", "Path": "/dev/cpuctl", Loading
libprocessgroup/profiles/task_profiles.json +53 −0 Original line number Original line Diff line number Diff line Loading @@ -333,6 +333,59 @@ ] ] }, }, { "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", "Name": "TimerSlackHigh", "Actions" : [ "Actions" : [ Loading
libprocessgroup/sched_policy.cpp +19 −10 Original line number Original line Diff line number Diff line Loading @@ -46,20 +46,20 @@ int set_cpuset_policy(int tid, SchedPolicy policy) { switch (policy) { switch (policy) { case SP_BACKGROUND: case SP_BACKGROUND: return SetTaskProfiles(tid, return SetTaskProfiles(tid, {"HighEnergySaving", "ProcessCapacityLow", "LowIoPriority", {"HighEnergySaving", "ProcessCapacityLow", "TimerSlackHigh"}) "TimerSlackHigh"}) ? 0 ? 0 : -1; : -1; case SP_FOREGROUND: case SP_FOREGROUND: case SP_AUDIO_APP: case SP_AUDIO_APP: case SP_AUDIO_SYS: case SP_AUDIO_SYS: return SetTaskProfiles(tid, return SetTaskProfiles(tid, {"HighPerformance", "ProcessCapacityHigh", "HighIoPriority", {"HighPerformance", "ProcessCapacityHigh", "TimerSlackNormal"}) "TimerSlackNormal"}) ? 0 ? 0 : -1; : -1; case SP_TOP_APP: case SP_TOP_APP: return SetTaskProfiles(tid, return SetTaskProfiles(tid, {"MaxPerformance", "ProcessCapacityMax", "MaxIoPriority", {"MaxPerformance", "ProcessCapacityMax", "TimerSlackNormal"}) "TimerSlackNormal"}) ? 0 ? 0 : -1; : -1; case SP_SYSTEM: case SP_SYSTEM: Loading Loading @@ -126,15 +126,24 @@ int set_sched_policy(int tid, SchedPolicy policy) { switch (policy) { switch (policy) { case SP_BACKGROUND: case SP_BACKGROUND: return SetTaskProfiles(tid, {"HighEnergySaving", "TimerSlackHigh"}) ? 0 : -1; return SetTaskProfiles(tid, {"HighEnergySaving", "LowIoPriority", "TimerSlackHigh"}) ? 0 : -1; case SP_FOREGROUND: case SP_FOREGROUND: case SP_AUDIO_APP: case SP_AUDIO_APP: case SP_AUDIO_SYS: case SP_AUDIO_SYS: return SetTaskProfiles(tid, {"HighPerformance", "TimerSlackNormal"}) ? 0 : -1; return SetTaskProfiles(tid, {"HighPerformance", "HighIoPriority", "TimerSlackNormal"}) ? 0 : -1; case SP_TOP_APP: case SP_TOP_APP: return SetTaskProfiles(tid, {"MaxPerformance", "TimerSlackNormal"}) ? 0 : -1; return SetTaskProfiles(tid, {"MaxPerformance", "MaxIoPriority", "TimerSlackNormal"}) ? 0 : -1; case SP_RT_APP: case SP_RT_APP: return SetTaskProfiles(tid, {"RealtimePerformance", "TimerSlackNormal"}) ? 0 : -1; return SetTaskProfiles(tid, {"RealtimePerformance", "MaxIoPriority", "TimerSlackNormal"}) ? 0 : -1; default: default: return SetTaskProfiles(tid, {"TimerSlackNormal"}) ? 0 : -1; return SetTaskProfiles(tid, {"TimerSlackNormal"}) ? 0 : -1; } } Loading
rootdir/init.rc +9 −0 Original line number Original line Diff line number Diff line Loading @@ -84,6 +84,15 @@ on init chmod 0664 /dev/stune/top-app/tasks chmod 0664 /dev/stune/top-app/tasks chmod 0664 /dev/stune/rt/tasks chmod 0664 /dev/stune/rt/tasks # Create blkio tuning nodes mkdir /dev/blkio/background chown system system /dev/blkio chown system system /dev/blkio/background chown system system /dev/blkio/tasks chown system system /dev/blkio/background/tasks chmod 0664 /dev/blkio/tasks chmod 0664 /dev/blkio/background/tasks restorecon_recursive /mnt restorecon_recursive /mnt mount configfs none /config nodev noexec nosuid mount configfs none /config nodev noexec nosuid Loading