From 43c5e96ce4f53273623726120cd72c9740d815ff Mon Sep 17 00:00:00 2001 From: Daeho Jeong Date: Wed, 25 May 2022 08:37:17 -0700 Subject: [PATCH 1/3] disable powerhint for F2FS gc_urgent mode Disable the powerhint for F2FS gc_urgent mode, since we are going to replace this with the smart idle maintenance service. Test: turn on/off the screen & check /sys/fs/f2fs/dm-*/gc_urgent Bug: 214430685 Signed-off-by: Daeho Jeong Change-Id: I6acf8e9e8a8d7e33d89acb1be44ea340e3f02241 --- powerhint-oriole.json | 21 --------------------- powerhint-raven.json | 21 --------------------- powerhint-slider.json | 21 --------------------- powerhint-whitefin.json | 21 --------------------- 4 files changed, 84 deletions(-) diff --git a/powerhint-oriole.json b/powerhint-oriole.json index e70f0bb..3a1db55 100644 --- a/powerhint-oriole.json +++ b/powerhint-oriole.json @@ -250,15 +250,6 @@ ], "ResetOnInit": true }, - { - "Name": "F2fsRecessModeEnable", - "Path": "/dev/sys/fs/by-name/userdata/gc_urgent", - "Values": [ - "2", - "0" - ], - "ResetOnInit": true - }, { "Name": "TAPreferHighCap", "Path": "/proc/vendor_sched/ta_prefer_high_cap", @@ -491,12 +482,6 @@ "Duration": 5000, "Value": "85" }, - { - "PowerHint": "DEVICE_IDLE", - "Node": "F2fsRecessModeEnable", - "Duration": 0, - "Value": "2" - }, { "PowerHint": "LAUNCH", "Node": "UClampThreshold", @@ -569,12 +554,6 @@ "Duration": 5000, "Value": "0" }, - { - "PowerHint": "DISPLAY_INACTIVE", - "Node": "F2fsRecessModeEnable", - "Duration": 0, - "Value": "2" - }, { "PowerHint": "CAMERA_LAUNCH", "Node": "MemFreq", diff --git a/powerhint-raven.json b/powerhint-raven.json index 3e2053e..8d30a53 100644 --- a/powerhint-raven.json +++ b/powerhint-raven.json @@ -250,15 +250,6 @@ ], "ResetOnInit": true }, - { - "Name": "F2fsRecessModeEnable", - "Path": "/dev/sys/fs/by-name/userdata/gc_urgent", - "Values": [ - "2", - "0" - ], - "ResetOnInit": true - }, { "Name": "TAPreferHighCap", "Path": "/proc/vendor_sched/ta_prefer_high_cap", @@ -491,12 +482,6 @@ "Duration": 5000, "Value": "85" }, - { - "PowerHint": "DEVICE_IDLE", - "Node": "F2fsRecessModeEnable", - "Duration": 0, - "Value": "2" - }, { "PowerHint": "LAUNCH", "Node": "UClampThreshold", @@ -580,12 +565,6 @@ "Duration": 5000, "Value": "0" }, - { - "PowerHint": "DISPLAY_INACTIVE", - "Node": "F2fsRecessModeEnable", - "Duration": 0, - "Value": "2" - }, { "PowerHint": "CAMERA_LAUNCH", "Node": "MemFreq", diff --git a/powerhint-slider.json b/powerhint-slider.json index 08d6f30..77765c8 100644 --- a/powerhint-slider.json +++ b/powerhint-slider.json @@ -245,15 +245,6 @@ ], "ResetOnInit": true }, - { - "Name": "F2fsRecessModeEnable", - "Path": "/dev/sys/fs/by-name/userdata/gc_urgent", - "Values": [ - "2", - "0" - ], - "ResetOnInit": true - }, { "Name": "TAPreferHighCap", "Path": "/proc/vendor_sched/ta_prefer_high_cap", @@ -442,12 +433,6 @@ "Duration": 5000, "Value": "85" }, - { - "PowerHint": "DEVICE_IDLE", - "Node": "F2fsRecessModeEnable", - "Duration": 0, - "Value": "2" - }, { "PowerHint": "LAUNCH", "Node": "UClampThreshold", @@ -525,12 +510,6 @@ "Duration": 5000, "Value": "0" }, - { - "PowerHint": "DISPLAY_INACTIVE", - "Node": "F2fsRecessModeEnable", - "Duration": 0, - "Value": "2" - }, { "PowerHint": "CAMERA_LAUNCH", "Node": "MemFreq", diff --git a/powerhint-whitefin.json b/powerhint-whitefin.json index 00b2d5e..c502a78 100644 --- a/powerhint-whitefin.json +++ b/powerhint-whitefin.json @@ -245,15 +245,6 @@ ], "ResetOnInit": true }, - { - "Name": "F2fsRecessModeEnable", - "Path": "/dev/sys/fs/by-name/userdata/gc_urgent", - "Values": [ - "2", - "0" - ], - "ResetOnInit": true - }, { "Name": "TAPreferHighCap", "Path": "/proc/vendor_sched/ta_prefer_high_cap", @@ -433,12 +424,6 @@ "Duration": 5000, "Value": "85" }, - { - "PowerHint": "DEVICE_IDLE", - "Node": "F2fsRecessModeEnable", - "Duration": 0, - "Value": "2" - }, { "PowerHint": "LAUNCH", "Node": "UClampThreshold", @@ -516,12 +501,6 @@ "Duration": 5000, "Value": "0" }, - { - "PowerHint": "DISPLAY_INACTIVE", - "Node": "F2fsRecessModeEnable", - "Duration": 0, - "Value": "2" - }, { "PowerHint": "CAMERA_LAUNCH", "Node": "MemFreq", From 15215ef471b210df6443da3f525316ab349bbb76 Mon Sep 17 00:00:00 2001 From: jimmyshiu Date: Fri, 20 May 2022 13:08:36 +0000 Subject: [PATCH 2/3] ADPF: Skip I signal and set Uclamp init value Skip I signal by setting kI to 0 and use UclampMinInit as the display update boost value. Bug: 232992641 Test: Manual Test Change-Id: Iee49cb054817d49d18498ceced61446916669887 --- powerhint-oriole.json | 12 +++++++++--- powerhint-raven.json | 12 +++++++++--- powerhint-slider.json | 12 +++++++++--- powerhint-whitefin.json | 12 +++++++++--- 4 files changed, 36 insertions(+), 12 deletions(-) diff --git a/powerhint-oriole.json b/powerhint-oriole.json index 3a1db55..48c0e51 100644 --- a/powerhint-oriole.json +++ b/powerhint-oriole.json @@ -1617,13 +1617,14 @@ "PID_On": true, "PID_Po": 2.0, "PID_Pu": 1.0, - "PID_I": 0.001, + "PID_I": 0.0, "PID_I_Init": 200, "PID_I_High": 512, "PID_I_Low": -30, "PID_Do": 500.0, "PID_Du": 0.0, "UclampMin_On": true, + "UclampMin_Init": 185, "UclampMin_High": 384, "UclampMin_Low": 2, "SamplingWindow_P": 1, @@ -1640,13 +1641,14 @@ "PID_On": true, "PID_Po": 2.0, "PID_Pu": 1.0, - "PID_I": 0.001, + "PID_I": 0.0, "PID_I_Init": 200, "PID_I_High": 512, "PID_I_Low": -30, "PID_Do": 500.0, "PID_Du": 0.0, "UclampMin_On": true, + "UclampMin_Init": 129, "UclampMin_High": 384, "UclampMin_Low": 2, "SamplingWindow_P": 1, @@ -1663,13 +1665,14 @@ "PID_On": true, "PID_Po": 2.0, "PID_Pu": 1.0, - "PID_I": 0.001, + "PID_I": 0.0, "PID_I_Init": 200, "PID_I_High": 512, "PID_I_Low": -30, "PID_Do": 500.0, "PID_Du": 0.0, "UclampMin_On": true, + "UclampMin_Init": 129, "UclampMin_High": 384, "UclampMin_Low": 2, "SamplingWindow_P": 1, @@ -1696,6 +1699,7 @@ "SamplingWindow_I": 1, "SamplingWindow_D": 1, "UclampMin_On": true, + "UclampMin_Init": 200, "UclampMin_High": 157, "UclampMin_Low": 157, "ReportingRateLimitNs": 1, @@ -1719,6 +1723,7 @@ "SamplingWindow_I": 1, "SamplingWindow_D": 1, "UclampMin_On": true, + "UclampMin_Init": 200, "UclampMin_High": 42, "UclampMin_Low": 42, "ReportingRateLimitNs": 1, @@ -1742,6 +1747,7 @@ "SamplingWindow_I": 1, "SamplingWindow_D": 1, "UclampMin_On": true, + "UclampMin_Init": 200, "UclampMin_High": 0, "UclampMin_Low": 0, "ReportingRateLimitNs": 1, diff --git a/powerhint-raven.json b/powerhint-raven.json index 8d30a53..da30e1c 100644 --- a/powerhint-raven.json +++ b/powerhint-raven.json @@ -1633,13 +1633,14 @@ "PID_On": true, "PID_Po": 2.0, "PID_Pu": 1.0, - "PID_I": 0.001, + "PID_I": 0.0, "PID_I_Init": 200, "PID_I_High": 512, "PID_I_Low": -30, "PID_Do": 500.0, "PID_Du": 0.0, "UclampMin_On": true, + "UclampMin_Init": 185, "UclampMin_High": 384, "UclampMin_Low": 2, "SamplingWindow_P": 1, @@ -1656,13 +1657,14 @@ "PID_On": true, "PID_Po": 2.0, "PID_Pu": 1.0, - "PID_I": 0.001, + "PID_I": 0.0, "PID_I_Init": 200, "PID_I_High": 512, "PID_I_Low": -30, "PID_Do": 500.0, "PID_Du": 0.0, "UclampMin_On": true, + "UclampMin_Init": 129, "UclampMin_High": 384, "UclampMin_Low": 2, "SamplingWindow_P": 1, @@ -1679,13 +1681,14 @@ "PID_On": true, "PID_Po": 2.0, "PID_Pu": 1.0, - "PID_I": 0.001, + "PID_I": 0.0, "PID_I_Init": 200, "PID_I_High": 512, "PID_I_Low": -30, "PID_Do": 500.0, "PID_Du": 0.0, "UclampMin_On": true, + "UclampMin_Init": 129, "UclampMin_High": 384, "UclampMin_Low": 2, "SamplingWindow_P": 1, @@ -1712,6 +1715,7 @@ "SamplingWindow_I": 1, "SamplingWindow_D": 1, "UclampMin_On": true, + "UclampMin_Init": 200, "UclampMin_High": 157, "UclampMin_Low": 157, "ReportingRateLimitNs": 1, @@ -1735,6 +1739,7 @@ "SamplingWindow_I": 1, "SamplingWindow_D": 1, "UclampMin_On": true, + "UclampMin_Init": 200, "UclampMin_High": 42, "UclampMin_Low": 42, "ReportingRateLimitNs": 1, @@ -1758,6 +1763,7 @@ "SamplingWindow_I": 1, "SamplingWindow_D": 1, "UclampMin_On": true, + "UclampMin_Init": 200, "UclampMin_High": 0, "UclampMin_Low": 0, "ReportingRateLimitNs": 1, diff --git a/powerhint-slider.json b/powerhint-slider.json index 77765c8..1e2df3f 100644 --- a/powerhint-slider.json +++ b/powerhint-slider.json @@ -1509,13 +1509,14 @@ "PID_On": true, "PID_Po": 2.0, "PID_Pu": 1.0, - "PID_I": 0.001, + "PID_I": 0.0, "PID_I_Init": 200, "PID_I_High": 512, "PID_I_Low": -30, "PID_Do": 500.0, "PID_Du": 0.0, "UclampMin_On": true, + "UclampMin_Init": 185, "UclampMin_High": 384, "UclampMin_Low": 2, "SamplingWindow_P": 1, @@ -1532,13 +1533,14 @@ "PID_On": true, "PID_Po": 2.0, "PID_Pu": 1.0, - "PID_I": 0.001, + "PID_I": 0.0, "PID_I_Init": 200, "PID_I_High": 512, "PID_I_Low": -30, "PID_Do": 500.0, "PID_Du": 0.0, "UclampMin_On": true, + "UclampMin_Init": 129, "UclampMin_High": 384, "UclampMin_Low": 2, "SamplingWindow_P": 1, @@ -1555,13 +1557,14 @@ "PID_On": true, "PID_Po": 2.0, "PID_Pu": 1.0, - "PID_I": 0.001, + "PID_I": 0.0, "PID_I_Init": 200, "PID_I_High": 512, "PID_I_Low": -30, "PID_Do": 500.0, "PID_Du": 0.0, "UclampMin_On": true, + "UclampMin_Init": 129, "UclampMin_High": 384, "UclampMin_Low": 2, "SamplingWindow_P": 1, @@ -1588,6 +1591,7 @@ "SamplingWindow_I": 1, "SamplingWindow_D": 1, "UclampMin_On": true, + "UclampMin_Init": 200, "UclampMin_High": 157, "UclampMin_Low": 157, "ReportingRateLimitNs": 1, @@ -1611,6 +1615,7 @@ "SamplingWindow_I": 1, "SamplingWindow_D": 1, "UclampMin_On": true, + "UclampMin_Init": 200, "UclampMin_High": 42, "UclampMin_Low": 42, "ReportingRateLimitNs": 1, @@ -1634,6 +1639,7 @@ "SamplingWindow_I": 1, "SamplingWindow_D": 1, "UclampMin_On": true, + "UclampMin_Init": 200, "UclampMin_High": 0, "UclampMin_Low": 0, "ReportingRateLimitNs": 1, diff --git a/powerhint-whitefin.json b/powerhint-whitefin.json index c502a78..a590283 100644 --- a/powerhint-whitefin.json +++ b/powerhint-whitefin.json @@ -1476,13 +1476,14 @@ "PID_On": true, "PID_Po": 2.0, "PID_Pu": 1.0, - "PID_I": 0.001, + "PID_I": 0.0, "PID_I_Init": 200, "PID_I_High": 512, "PID_I_Low": -30, "PID_Do": 500.0, "PID_Du": 0.0, "UclampMin_On": true, + "UclampMin_Init": 185, "UclampMin_High": 384, "UclampMin_Low": 2, "SamplingWindow_P": 1, @@ -1499,13 +1500,14 @@ "PID_On": true, "PID_Po": 2.0, "PID_Pu": 1.0, - "PID_I": 0.001, + "PID_I": 0.0, "PID_I_Init": 200, "PID_I_High": 512, "PID_I_Low": -30, "PID_Do": 500.0, "PID_Du": 0.0, "UclampMin_On": true, + "UclampMin_Init": 129, "UclampMin_High": 384, "UclampMin_Low": 2, "SamplingWindow_P": 1, @@ -1522,13 +1524,14 @@ "PID_On": true, "PID_Po": 2.0, "PID_Pu": 1.0, - "PID_I": 0.001, + "PID_I": 0.0, "PID_I_Init": 200, "PID_I_High": 512, "PID_I_Low": -30, "PID_Do": 500.0, "PID_Du": 0.0, "UclampMin_On": true, + "UclampMin_Init": 129, "UclampMin_High": 384, "UclampMin_Low": 2, "SamplingWindow_P": 1, @@ -1555,6 +1558,7 @@ "SamplingWindow_I": 1, "SamplingWindow_D": 1, "UclampMin_On": true, + "UclampMin_Init": 200, "UclampMin_High": 157, "UclampMin_Low": 157, "ReportingRateLimitNs": 1, @@ -1578,6 +1582,7 @@ "SamplingWindow_I": 1, "SamplingWindow_D": 1, "UclampMin_On": true, + "UclampMin_Init": 200, "UclampMin_High": 42, "UclampMin_Low": 42, "ReportingRateLimitNs": 1, @@ -1601,6 +1606,7 @@ "SamplingWindow_I": 1, "SamplingWindow_D": 1, "UclampMin_On": true, + "UclampMin_Init": 200, "UclampMin_High": 0, "UclampMin_Low": 0, "ReportingRateLimitNs": 1, From 3e31f8820881ca1302f0d2aa664da2a36e1befa2 Mon Sep 17 00:00:00 2001 From: Richard Hsu Date: Tue, 17 May 2022 18:58:17 -0700 Subject: [PATCH 3/3] [Tuning] Disable CPU Idle in NNAPI workload with PMQoS CPU DMA Latency To improve the return path latency, we want to keep the CPU at at least WFI state (Idle_1). The PMQos cpu_dma_latency knob prevents the CPU from falling below WFI state. This makes the return path CPU wakeup latency very good. Check with wvw@, the power impact shouldn't be too significant. The average energy cost per inference dropped from 3.85 to 3.47 mJ. The reason why the power number is lower WITH disable-idle is that, due to better latency, we get to run more inferences given the same amount of time. This makes the average power consumption lower. Measurement: MLPerf IC model Latency (ms) Power (mW) Energy/inference (mJ) MLPerf scores Default 1.35 2837 3.85 560 Disable CPU Idle 0.98 3539 3.47 826 https://docs.google.com/presentation/d/1zx7sLkhOClmuRTCrq8-l3N1mZrrv7f-CtcdMuzV0eaI/edit?pli=1#slide=id.g12dd9e50b4b_0_0 Bug: 232183574 Test: MLPerf on Android T. Performance improved. Verified on Perfetto. Change-Id: If067e0851bea0475043ef2127a25ed3a5fdab093 --- powerhint-oriole.json | 15 +++++++++++++++ powerhint-raven.json | 15 +++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/powerhint-oriole.json b/powerhint-oriole.json index 48c0e51..314f634 100644 --- a/powerhint-oriole.json +++ b/powerhint-oriole.json @@ -196,6 +196,15 @@ ], "ResetOnInit": true }, + { + "Name": "PMQoSCpuDmaLatency", + "Path": "/dev/cpu_dma_latency", + "Values": [ + "44", + "1000" + ], + "HoldFd": true + }, { "Name": "CDPreferIdle", "Path": "/proc/vendor_sched/cam_prefer_idle", @@ -1592,6 +1601,12 @@ "Duration": 2000, "Value": "512" }, + { + "PowerHint": "ML_ACC", + "Node": "PMQoSCpuDmaLatency", + "Duration": 2000, + "Value": "44" + }, { "PowerHint": "DEVICE_IDLE", "Node": "RestrictedCpuset", diff --git a/powerhint-raven.json b/powerhint-raven.json index da30e1c..3b9b980 100644 --- a/powerhint-raven.json +++ b/powerhint-raven.json @@ -196,6 +196,15 @@ ], "ResetOnInit": true }, + { + "Name": "PMQoSCpuDmaLatency", + "Path": "/dev/cpu_dma_latency", + "Values": [ + "44", + "1000" + ], + "HoldFd": true + }, { "Name": "CDPreferIdle", "Path": "/proc/vendor_sched/cam_prefer_idle", @@ -1608,6 +1617,12 @@ "Duration": 2000, "Value": "512" }, + { + "PowerHint": "ML_ACC", + "Node": "PMQoSCpuDmaLatency", + "Duration": 2000, + "Value": "44" + }, { "PowerHint": "DEVICE_IDLE", "Node": "RestrictedCpuset",