From 03eae68a00cd44feb9a4781b314945c2c757b302 Mon Sep 17 00:00:00 2001 From: Yvonne Yip Date: Mon, 17 Jun 2024 16:30:57 -0700 Subject: [PATCH 1/4] powerhint: Explicitly set DownRateLimitUs for camera So that we can change the default values without impacting it. Bug: 315748906powerhint: Explicitly set DownRateLimitUs for camera So that we can change the default values without impacting it. Bug: 315748906 Test: build Flag: NONE powerhint change does not support flags (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:9084165d0d0f699f7cc3968dded4f71d4ec20a92) (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:62542ec65031c1cdf2e973c0d6eca3518d5f986c) Merged-In: Ic14d51f0b5b512f5557d904d682e9f934bbab87f Change-Id: Ic14d51f0b5b512f5557d904d682e9f934bbab87f --- powerhint-comet.json | 90 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) diff --git a/powerhint-comet.json b/powerhint-comet.json index 34f0f19..00d6ca1 100644 --- a/powerhint-comet.json +++ b/powerhint-comet.json @@ -1817,6 +1817,24 @@ "Duration": 0, "Value": "cam2" }, + { + "PowerHint": "CAMERA_STREAMING_EXTREME", + "Node": "CPULittleClusterDownRateLimitUs", + "Duration": 0, + "Value": "5000" + }, + { + "PowerHint": "CAMERA_STREAMING_EXTREME", + "Node": "CPUMidClusterDownRateLimitUs", + "Duration": 0, + "Value": "20000" + }, + { + "PowerHint": "CAMERA_STREAMING_EXTREME", + "Node": "CPUBigClusterDownRateLimitUs", + "Duration": 0, + "Value": "20000" + }, { "PowerHint": "CAMERA_STREAMING_EXTREME", "Node": "CPUDVFSHeadroom", @@ -1955,6 +1973,24 @@ "Duration": 0, "Value": "cam2" }, + { + "PowerHint": "CAMERA_STREAMING_HIGH", + "Node": "CPULittleClusterDownRateLimitUs", + "Duration": 0, + "Value": "5000" + }, + { + "PowerHint": "CAMERA_STREAMING_HIGH", + "Node": "CPUMidClusterDownRateLimitUs", + "Duration": 0, + "Value": "20000" + }, + { + "PowerHint": "CAMERA_STREAMING_HIGH", + "Node": "CPUBigClusterDownRateLimitUs", + "Duration": 0, + "Value": "20000" + }, { "PowerHint": "CAMERA_STREAMING_HIGH", "Node": "CPUUtilThreshold", @@ -2117,6 +2153,24 @@ "Duration": 0, "Value": "1100 1024 1100" }, + { + "PowerHint": "CAMERA_STREAMING_STANDARD", + "Node": "CPULittleClusterDownRateLimitUs", + "Duration": 0, + "Value": "5000" + }, + { + "PowerHint": "CAMERA_STREAMING_STANDARD", + "Node": "CPUMidClusterDownRateLimitUs", + "Duration": 0, + "Value": "20000" + }, + { + "PowerHint": "CAMERA_STREAMING_STANDARD", + "Node": "CPUBigClusterDownRateLimitUs", + "Duration": 0, + "Value": "20000" + }, { "PowerHint": "CAMERA_STREAMING_STANDARD", "Node": "CPUDVFSHeadroom", @@ -2195,6 +2249,24 @@ "Duration": 0, "Value": "0" }, + { + "PowerHint": "CAMERA_STREAMING_LOW", + "Node": "CPULittleClusterDownRateLimitUs", + "Duration": 0, + "Value": "5000" + }, + { + "PowerHint": "CAMERA_STREAMING_LOW", + "Node": "CPUMidClusterDownRateLimitUs", + "Duration": 0, + "Value": "20000" + }, + { + "PowerHint": "CAMERA_STREAMING_LOW", + "Node": "CPUBigClusterDownRateLimitUs", + "Duration": 0, + "Value": "20000" + }, { "PowerHint": "CAMERA_STREAMING_LOW", "Node": "CPUDVFSHeadroom", @@ -3006,6 +3078,24 @@ "Duration": 2000, "Value": "44" }, + { + "PowerHint": "CAMERA_PROJECT11", + "Node": "CPULittleClusterDownRateLimitUs", + "Duration": 0, + "Value": "5000" + }, + { + "PowerHint": "CAMERA_PROJECT11", + "Node": "CPUMidClusterDownRateLimitUs", + "Duration": 0, + "Value": "20000" + }, + { + "PowerHint": "CAMERA_PROJECT11", + "Node": "CPUBigClusterDownRateLimitUs", + "Duration": 0, + "Value": "20000" + }, { "PowerHint": "CAMERA_PROJECT11", "Node": "AutoPreferIdle", From 8febd2f5530da95c70e4d7bd874f7906aac19ca1 Mon Sep 17 00:00:00 2001 From: Yvonne Yip Date: Mon, 17 Jun 2024 16:36:15 -0700 Subject: [PATCH 2/4] powerhint: Add nodes required to enable auto migration margins/dvfs headroom Everything should be disabled by default. Make sure camera and game explicitly disable them by default too. Ensure the feature is disable when screen is idle. Bug: 315748906 Test: build Flag: NONE powerhint change does not support flags (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:bb4df08c9ea617625d25cf12bc60c41c173d996b) (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:b804969d8faa70065f9ed4a5ba841a607cbedb3b) Merged-In: Ibd08cec303010e87057463f5aff737a5105e04b6 Change-Id: Ibd08cec303010e87057463f5aff737a5105e04b6 --- powerhint-comet.json | 162 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 162 insertions(+) diff --git a/powerhint-comet.json b/powerhint-comet.json index 00d6ca1..04bf641 100644 --- a/powerhint-comet.json +++ b/powerhint-comet.json @@ -205,6 +205,60 @@ "DefaultIndex": 0, "ResetOnInit": true }, + { + "Name": "AutoMigrationMarginsEnable", + "Path": "/proc/vendor_sched/auto_migration_margins_enable", + "Values": [ + "0", + "1" + ], + "DefaultIndex": 0, + "ResetOnInit": true + }, + { + "Name": "AutoDvfsHeadroomEnable", + "Path": "/proc/vendor_sched/auto_dvfs_headroom_enable", + "Values": [ + "0", + "1" + ], + "DefaultIndex": 0, + "ResetOnInit": true + }, + { + "Name": "TARampupMultiplier", + "Path": "/proc/vendor_sched/groups/ta/rampup_multiplier", + "Values": [ + "0", + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8" + ], + "DefaultIndex": 1, + "ResetOnInit": true + }, + { + "Name": "AdpfRampupMultiplier", + "Path": "/proc/vendor_sched/adpf_rampup_multiplier", + "Values": [ + "0", + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8" + ], + "DefaultIndex": 2, + "ResetOnInit": true + }, { "Name": "CPUUClampMaxFilterEnable", "Path": "/proc/vendor_sched/uclamp_max_filter_enable", @@ -1817,6 +1871,18 @@ "Duration": 0, "Value": "cam2" }, + { + "PowerHint": "CAMERA_STREAMING_EXTREME", + "Node": "AutoMigrationMarginsEnable", + "Duration": 0, + "Value": "0" + }, + { + "PowerHint": "CAMERA_STREAMING_EXTREME", + "Node": "AutoDvfsHeadroomEnable", + "Duration": 0, + "Value": "0" + }, { "PowerHint": "CAMERA_STREAMING_EXTREME", "Node": "CPULittleClusterDownRateLimitUs", @@ -1973,6 +2039,18 @@ "Duration": 0, "Value": "cam2" }, + { + "PowerHint": "CAMERA_STREAMING_HIGH", + "Node": "AutoMigrationMarginsEnable", + "Duration": 0, + "Value": "0" + }, + { + "PowerHint": "CAMERA_STREAMING_HIGH", + "Node": "AutoDvfsHeadroomEnable", + "Duration": 0, + "Value": "0" + }, { "PowerHint": "CAMERA_STREAMING_HIGH", "Node": "CPULittleClusterDownRateLimitUs", @@ -2153,6 +2231,18 @@ "Duration": 0, "Value": "1100 1024 1100" }, + { + "PowerHint": "CAMERA_STREAMING_STANDARD", + "Node": "AutoMigrationMarginsEnable", + "Duration": 0, + "Value": "0" + }, + { + "PowerHint": "CAMERA_STREAMING_STANDARD", + "Node": "AutoDvfsHeadroomEnable", + "Duration": 0, + "Value": "0" + }, { "PowerHint": "CAMERA_STREAMING_STANDARD", "Node": "CPULittleClusterDownRateLimitUs", @@ -2249,6 +2339,18 @@ "Duration": 0, "Value": "0" }, + { + "PowerHint": "CAMERA_STREAMING_LOW", + "Node": "AutoMigrationMarginsEnable", + "Duration": 0, + "Value": "0" + }, + { + "PowerHint": "CAMERA_STREAMING_LOW", + "Node": "AutoDvfsHeadroomEnable", + "Duration": 0, + "Value": "0" + }, { "PowerHint": "CAMERA_STREAMING_LOW", "Node": "CPULittleClusterDownRateLimitUs", @@ -2465,6 +2567,18 @@ "Duration": 0, "Value": "0-6" }, + { + "PowerHint": "CAMERA_STREAMING_VIDEO_CALL", + "Node": "AutoMigrationMarginsEnable", + "Duration": 0, + "Value": "0" + }, + { + "PowerHint": "CAMERA_STREAMING_VIDEO_CALL", + "Node": "AutoDvfsHeadroomEnable", + "Duration": 0, + "Value": "0" + }, { "PowerHint": "CAMERA_STREAMING_VIDEO_CALL", "Node": "CPUDVFSHeadroom", @@ -2754,6 +2868,18 @@ "Type": "EndHint", "Value": "DISPLAY_UPDATE_IMMINENT" }, + { + "PowerHint": "DISPLAY_IDLE", + "Node": "TARampupMultiplier", + "Duration": 0, + "Value": "0" + }, + { + "PowerHint": "DISPLAY_IDLE", + "Node": "AdpfRampupMultiplier", + "Duration": 0, + "Value": "0" + }, { "PowerHint": "DISPLAY_UPDATE_IMMINENT", "Node": "CPULittleClusterDownRateLimitUs", @@ -2982,6 +3108,30 @@ "Duration": 0, "Value": "1" }, + { + "PowerHint": "GAME", + "Node": "AutoMigrationMarginsEnable", + "Duration": 0, + "Value": "0" + }, + { + "PowerHint": "GAME", + "Node": "AutoDvfsHeadroomEnable", + "Duration": 0, + "Value": "0" + }, + { + "PowerHint": "GAME", + "Node": "TARampupMultiplier", + "Duration": 0, + "Value": "1" + }, + { + "PowerHint": "GAME", + "Node": "AdpfRampupMultiplier", + "Duration": 0, + "Value": "2" + }, { "PowerHint": "FACE_UNLOCK_BOOST", "Node": "CPUMidClusterMaxFreq", @@ -3078,6 +3228,18 @@ "Duration": 2000, "Value": "44" }, + { + "PowerHint": "CAMERA_PROJECT11", + "Node": "AutoMigrationMarginsEnable", + "Duration": 0, + "Value": "0" + }, + { + "PowerHint": "CAMERA_PROJECT11", + "Node": "AutoDvfsHeadroomEnable", + "Duration": 0, + "Value": "0" + }, { "PowerHint": "CAMERA_PROJECT11", "Node": "CPULittleClusterDownRateLimitUs", From 3587e2c602a4c82d492396f347577653daa5c178 Mon Sep 17 00:00:00 2001 From: Yvonne Yip Date: Mon, 17 Jun 2024 16:41:14 -0700 Subject: [PATCH 3/4] powerhint: Add nodes to control per-task iowait boost It's disabled by default. Ensure camera and game mode explicitly disable it too as it is only required when auto margins are enabled for now. Ensure it is disabled when screen is off too as We don't want io activities to cause wake up on bigger cores while screen is off. Bug: 340534339 Test: build Flag: NONE powerhint change does not support flags (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:dad48beaeb9f9fce8acb67c06bfd022e86ce0e0d) (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:51140ac43c0f5bd26357e6a26ba2f4914c70a2fe) Merged-In: Ie9d20fe5ad6b423e8c26a36b7f01592040292ead Change-Id: Ie9d20fe5ad6b423e8c26a36b7f01592040292ead --- powerhint-comet.json | 58 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/powerhint-comet.json b/powerhint-comet.json index 04bf641..e919b5b 100644 --- a/powerhint-comet.json +++ b/powerhint-comet.json @@ -259,6 +259,16 @@ "DefaultIndex": 2, "ResetOnInit": true }, + { + "Name": "PerTaskMaxIowaitBoost", + "Path": "/proc/vendor_sched/per_task_iowait_boost_max_value", + "Values": [ + "0", + "512" + ], + "DefaultIndex": 0, + "ResetOnInit": true + }, { "Name": "CPUUClampMaxFilterEnable", "Path": "/proc/vendor_sched/uclamp_max_filter_enable", @@ -1349,6 +1359,12 @@ "Duration": 0, "Value": "0x80" }, + { + "PowerHint": "DISPLAY_INACTIVE", + "Node": "PerTaskMaxIowaitBoost", + "Duration": 0, + "Value": "0" + }, { "PowerHint": "CAMERA_LAUNCH", "Node": "CPUSkipMask", @@ -1883,6 +1899,12 @@ "Duration": 0, "Value": "0" }, + { + "PowerHint": "CAMERA_STREAMING_EXTREME", + "Node": "PerTaskMaxIowaitBoost", + "Duration": 0, + "Value": "0" + }, { "PowerHint": "CAMERA_STREAMING_EXTREME", "Node": "CPULittleClusterDownRateLimitUs", @@ -2051,6 +2073,12 @@ "Duration": 0, "Value": "0" }, + { + "PowerHint": "CAMERA_STREAMING_HIGH", + "Node": "PerTaskMaxIowaitBoost", + "Duration": 0, + "Value": "0" + }, { "PowerHint": "CAMERA_STREAMING_HIGH", "Node": "CPULittleClusterDownRateLimitUs", @@ -2243,6 +2271,12 @@ "Duration": 0, "Value": "0" }, + { + "PowerHint": "CAMERA_STREAMING_STANDARD", + "Node": "PerTaskMaxIowaitBoost", + "Duration": 0, + "Value": "0" + }, { "PowerHint": "CAMERA_STREAMING_STANDARD", "Node": "CPULittleClusterDownRateLimitUs", @@ -2351,6 +2385,12 @@ "Duration": 0, "Value": "0" }, + { + "PowerHint": "CAMERA_STREAMING_LOW", + "Node": "PerTaskMaxIowaitBoost", + "Duration": 0, + "Value": "0" + }, { "PowerHint": "CAMERA_STREAMING_LOW", "Node": "CPULittleClusterDownRateLimitUs", @@ -2579,6 +2619,12 @@ "Duration": 0, "Value": "0" }, + { + "PowerHint": "CAMERA_STREAMING_VIDEO_CALL", + "Node": "PerTaskMaxIowaitBoost", + "Duration": 0, + "Value": "0" + }, { "PowerHint": "CAMERA_STREAMING_VIDEO_CALL", "Node": "CPUDVFSHeadroom", @@ -3132,6 +3178,12 @@ "Duration": 0, "Value": "2" }, + { + "PowerHint": "GAME", + "Node": "PerTaskMaxIowaitBoost", + "Duration": 0, + "Value": "0" + }, { "PowerHint": "FACE_UNLOCK_BOOST", "Node": "CPUMidClusterMaxFreq", @@ -3240,6 +3292,12 @@ "Duration": 0, "Value": "0" }, + { + "PowerHint": "CAMERA_PROJECT11", + "Node": "PerTaskMaxIowaitBoost", + "Duration": 0, + "Value": "0" + }, { "PowerHint": "CAMERA_PROJECT11", "Node": "CPULittleClusterDownRateLimitUs", From 0c57fb76e736a2b31f6c1ef2e88e1908fca76242 Mon Sep 17 00:00:00 2001 From: Yvonne Yip Date: Mon, 17 Jun 2024 16:43:09 -0700 Subject: [PATCH 4/4] powerhint: Enable auto migration margins/dvfs headroom for game mode Since the system is more reactive now when tasks are getting busier, set DownRateLimitUs to 500us to avoid increasing power. Also enable pertask iowait boost as util_avg will always start from 0 for forked tasks and this could impact io tasks that need additional help to ensure to migrate to bigger core if they need more perf. Bug: 315748906 Test: build Flag: NONE powerhint change does not support flags (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:61cf08366eb4e916beb1ad910754c8bc6c18bf14) (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:4d8c8dfade1027b7354af3c76dbe00894adfa5bd) Merged-In: I03a83cbf7b0c6fdf1abd3c63ccb96a38350d17da Change-Id: I03a83cbf7b0c6fdf1abd3c63ccb96a38350d17da --- powerhint-comet.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/powerhint-comet.json b/powerhint-comet.json index e919b5b..b25fac0 100644 --- a/powerhint-comet.json +++ b/powerhint-comet.json @@ -3122,13 +3122,13 @@ "PowerHint": "GAME", "Node": "CPUMidClusterDownRateLimitUs", "Duration": 0, - "Value": "3000" + "Value": "500" }, { "PowerHint": "GAME", "Node": "CPUBigClusterDownRateLimitUs", "Duration": 0, - "Value": "3000" + "Value": "500" }, { "PowerHint": "GAME", @@ -3158,13 +3158,13 @@ "PowerHint": "GAME", "Node": "AutoMigrationMarginsEnable", "Duration": 0, - "Value": "0" + "Value": "1" }, { "PowerHint": "GAME", "Node": "AutoDvfsHeadroomEnable", "Duration": 0, - "Value": "0" + "Value": "1" }, { "PowerHint": "GAME", @@ -3182,7 +3182,7 @@ "PowerHint": "GAME", "Node": "PerTaskMaxIowaitBoost", "Duration": 0, - "Value": "0" + "Value": "512" }, { "PowerHint": "FACE_UNLOCK_BOOST",