Commit graph

43 commits

Author SHA1 Message Date
Michael Bestas
dc28234ecd
gs-common: Update init scripts from BP2A
Change-Id: Ibb8d3715ec6cb9ebb5d89e116374d468dfcad826
2025-06-23 19:29:30 +03:00
Qais Yousef
5201b55858 init.pixel-perf.rc: Setup default rampup multiplier and util_est
Bug: 335874870
Flag: EXEMPT not supported for init.rc files
Signed-off-by: Qais Yousef <qyousef@google.com>
Change-Id: I41f1235e8c6f1ec57af3962c2a6cbc9707444917
2025-01-28 17:45:04 +00:00
Piotr Klasa
924237f464 move common init perf settings to gs_common
compared to ag/31352563 I did not transfer the settings for "write /sys/devices/system/cpu/cpuidle/current_governor teo", which caused the problem

Test: Verified if all values ​​of transferred settings are as they should be after rebooting the device, and and checked that there are no new selinux errors for hal_power_default, verified all metrics that caused power regression in the previous commit on abtd

Bug: 335874870

Flag: EXEMPT not supported by this component yet
Change-Id: If340ce8e8d3f3493045077470f8aa5560f9b313e
2025-01-23 03:35:46 -08:00
Piotr Klasa
d88ced0ff8 Revert "move common init perf settings to gs_common"
Revert submission 31215196-move_common_init_perf_settings_to_gscommon

Reason for revert: Power Regression

Reverted changes: /q/submissionid:31215196-move_common_init_perf_settings_to_gscommon
Bug: 390502171
Change-Id: I9b11900fd61e7f7abae52597aef41f5ab3c8ebd0
2025-01-20 07:00:49 -08:00
Piotr Klasa
3e2cacbc1e move common init perf settings to gs_common
Test: Verified if all values ​​of transferred settings are as they should be after rebooting the device, and and checked that there are no new selinux errors for hal_power_default
Bug: 335874870
Flag: EXEMPT not supported by this component yet

Change-Id: Ic544aa854962b0d975316113abbe798e34288155
2025-01-14 14:12:13 +00:00
Midas Chien
6a918f2bd3 allow power hal to access display files
avc:  denied  { write } for  name="early_wakeup" dev="sysfs" ino=110609 scontext=u:r:hal_power_default:s0 tcontext=u:object_r:sysfs_display:s0 tclass=file permissive=1
avc:  denied  { open } for path="/sys/devices/platform/sswrp_dpu@ec00000/ee00000.dc9x00/early_wakeup" dev="sysfs" ino=110609 scontext=u:r:hal_power_default:s0 tcontext=u:object_r:sysfs_display:s0
 class=file permissive=1

Bug: 350981178
Test: PowerHAL can access early_wakeup node in enforcing mode
Flag: EXEMPT bugfix
Change-Id: Ic9d619e971059d9b496a9e5c146089a01f6a0431
2025-01-05 20:22:27 -08:00
Richard Chang
cf29787f8d sepolicy: update init.te for zram device
Sync patch from zuma: ag/21578379, but move to gs-common.

Avc denied log:
avc:  denied  { write } for  comm="init" name="zram0" dev="tmpfs" ino=1306 scontext=u:r:init:s0 tcontext=u:object_r:ram_device:s0 tclass=blk_file permissive=1

Verify on PBuilds:
https://android-build.corp.google.com/abtd/run/L32800030008398424/

Bug: 370643878
Test: Boot and check avc denied logs
Flag: EXEMPT sepolicy
Change-Id: I90ea0b248835fa51fe07cfa23e5f819fd8422c08
2024-12-16 01:32:02 -08:00
Treehugger Robot
5a51adbdd3 Merge "allow power hal to access vendor_mm files" into main 2024-12-12 15:11:48 -08:00
Martin Liu
437d35e7cb allow power hal to access vendor_mm files
I auditd  : type=1400 audit(0.0:79): avc:  denied  { write } for  comm="NodeLooperThrea" name="vendor_mm" dev="sysfs" ino=56518 scontext=u:r:hal_power_default:s0 tcontext=u:object_r:sysfs_vendor_mm:s0 tclass=dir permissive=0

Bug: 357995885
Test: check avc error
Flag: EXEMPT adding avc rule
Change-Id: I1261aa14f2cd912ede51edc2e1a547d2e182ca46
Signed-off-by: Martin Liu <liumartin@google.com>
2024-12-12 13:38:20 +00:00
Piotr Klasa
78f0d4c8e6 Move all vendor_sched parameters and permissions to init.pixel.perf.rc
Bug: 335874870
Test: Checked that permissions and values ​​for all affected files are correct (ls -l, cat)
Flag: EXEMPT not supported by this component yet

Change-Id: Ia6dedcb49534d6be9007addca0d8d1080f219315
2024-12-11 06:35:06 -08:00
Dmitry Skiba
c0ac52ad63 Reapply "Add amm experiment."
See go/pixel-perf-amm-experiment for more info.

(This change is a reland of ag/30770395 after fixing issues that caused a revert.)

Bug: 365855872
Test: build/flash; set .Perf__amm_experiment=true, observe auto_migration_margins_enable value changing 1->0; set .Perf__amm_experiment="", observe the value changing 0->1
Flag: NONE controlled by Mendel instead
Change-Id: I833ea7cd104b95abf80f2286e91f96a102d8086a
Signed-off-by: Dmitry Skiba <dskiba@google.com>
2024-12-09 18:20:00 +00:00
Satish Yalla
b09df07b37 Merge "Revert "Add amm experiment."" into main 2024-12-09 07:25:12 +00:00
Satish Yalla
92b52953a3 Revert "Add amm experiment."
This reverts commit 842b86dcc1.

Reason for revert: DroidMonitor created revert due to b/382821677. Will be verified through ABTD for standard investigation.

Change-Id: I5b0d026155c2acb0d117aad7249592fc3fa72d61
2024-12-09 02:15:16 +00:00
Treehugger Robot
81762fe218 Merge "Add amm experiment." into main 2024-12-07 07:52:05 +00:00
Wei Wang
b848040c01 Merge "Add Proc Vendor Sched Sepolicy Fix" into main 2024-12-07 06:21:53 +00:00
Dmitry Skiba
842b86dcc1 Add amm experiment.
See go/pixel-perf-amm-experiment for more info.

Bug: 365855872
Test: build/flash; set .Perf__amm_experiment=true, observe auto_migration_margins_enable value changing 1->0; set .Perf__amm_experiment="", observe the value changing 0->1
Flag: NONE controlled by Mendel instead
Change-Id: I02b98e3601a0564929acb73250e2e943664bc80a
Signed-off-by: Dmitry Skiba <dskiba@google.com>
2024-12-06 22:15:49 +00:00
Dmitry Skiba
d5909db27f Add apf experiment.
See go/pixel-perf-apf-experiment for more info.

Bug: 365855872
Test: build/flash, set .Perf__apf_experiment=true and observe vendor.powerhal.apf_enabled=false, .apf_disabled=true
Flag: NONE controlled by Mendel instead
Change-Id: Iee32c4b160d5013fbbd893765d3df54c1befa458
Signed-off-by: Dmitry Skiba <dskiba@google.com>
2024-12-06 17:59:11 +00:00
Dmitry Skiba
4250b91047 Add kswapd experiment.
See go/pixel-perf-25q1-experiments for the info.

Bug: 365855872
Test: build/flash, set .Perf__experiments_delay_seconds=0, set .Perf__kswapd_experiment=true, observe /sys/kernel/vendor_mm/kswapd_cpu_affinity changes
Flag: NONE controlled by Mendel instead
Change-Id: Id63690f0dcd38de92e4c2fde5b0ab814ed3d9db1
Signed-off-by: Dmitry Skiba <dskiba@google.com>
2024-12-05 17:59:34 +00:00
Piotr Klasa
2c41fdac32 Add Proc Vendor Sched Sepolicy Fix
Bug: 361092565

Test: m atest && atest-dev com.google.android.selinux.pts.SELinuxTest#scanAvcDeniedLogRightAfterReboot
Test: adb shell dmesg | grep proc_vendor_sched ; adb logcat -d | grep proc_vendor_sched

Evidences

12-02 19:31:34.952   279   279 W init    : type=1400 audit(0.0:7): avc:  denied  { associate } for  name="uclamp_min" scontext=u:object_r:proc_vendor_sched:s0 tcontext=u:object_r:proc:s0 tclass=filesystem permissive=0
12-02 19:31:34.956   279   279 W init    : type=1400 audit(0.0:8): avc:  denied  { associate } for  name="prefer_idle" scontext=u:object_r:proc_vendor_sched:s0 tcontext=u:object_r:proc:s0 tclass=filesystem permissive=0
12-02 19:31:34.956   279   279 W init    : type=1400 audit(0.0:9): avc:  denied  { associate } for  name="uclamp_min" scontext=u:object_r:proc_vendor_sched:s0 tcontext=u:object_r:proc:s0 tclass=filesystem permissive=0
12-02 19:31:34.956   279   279 W init    : type=1400 audit(0.0:10): avc:  denied  { associate } for  name="prefer_idle" scontext=u:object_r:proc_vendor_sched:s0 tcontext=u:object_r:proc:s0 tclass=filesystem permissive=0
12-02 19:31:34.956   279   279 W init    : type=1400 audit(0.0:11): avc:  denied  { associate } for  name="uclamp_min" scontext=u:object_r:proc_vendor_sched:s0 tcontext=u:object_r:proc:s0 tclass=filesystem permissive=0
12-02 19:31:34.956   279   279 W init    : type=1400 audit(0.0:12): avc:  denied  { associate } for  name="prefer_idle" scontext=u:object_r:proc_vendor_sched:s0 tcontext=u:object_r:proc:s0 tclass=filesystem permissive=0
12-02 19:31:34.960   279   279 W init    : type=1400 audit(0.0:13): avc:  denied  { associate } for  name="prefer_idle" scontext=u:object_r:proc_vendor_sched:s0 tcontext=u:object_r:proc:s0 tclass=filesystem permissive=0
12-02 19:31:34.960   279   279 W init    : type=1400 audit(0.0:14): avc:  denied  { associate } for  name="uclamp_min" scontext=u:object_r:proc_vendor_sched:s0 tcontext=u:object_r:proc:s0 tclass=filesystem permissive=0
12-02 19:31:34.960   279   279 W init    : type=1400 audit(0.0:15): avc:  denied  { associate } for  name="prefer_idle" scontext=u:object_r:proc_vendor_sched:s0 tcontext=u:object_r:proc:s0 tclass=filesystem permissive=0
12-02 19:31:34.960   279   279 W init    : type=1400 audit(0.0:16): avc:  denied  { associate } for  name="uclamp_min" scontext=u:object_r:proc_vendor_sched:s0 tcontext=u:object_r:proc:s0 tclass=filesystem permissive=0

Flag: EXEMPT bugfix
Change-Id: Iad58e23abc1a7e27c3f5f4130e50d7e4aa0b6cf8
2024-12-05 12:05:19 +01:00
Dmitry Skiba
afc6c28401 Add recovery support for perf experiments.
This change establishes a place for perf experiments and adds a
script to delay experiments for recovery purposes. For more info
see go/pixel-perf-experiment-whatif.

Bug: 365855872
Test: build/flash, set .Perf__experiments_delay_seconds=10, verify that vendor.perf.allow_experiments=1 after 10 seconds
Flag: NONE controlled by Mendel instead
Change-Id: I78db482542066d5d5646d8c303dbe88054cfe66d
Signed-off-by: Dmitry Skiba <dskiba@google.com>
2024-12-05 09:07:27 +00:00
Will Song
db25f03ec3 Revert^2 "gs-common: Move cpufreq perf settings to gs-common"
Re-land after making SELinux corrections.

7606e41504

Bug: 335874870
Flag: NONE code refactor
Test: Boot and check parameters
Signed-off-by: Will Song <jinpengsong@google.com>
Change-Id: I8721e1fb7f9df5b476a27e2db8aea8a5c395b233
2024-11-22 09:08:17 -08:00
Will Song
168f30d8a1 Revert^2 "gs-common: Added common perf init.rc"
Re-land after making SELinux corrections.

98e6a61c1f

Bug: 335874870
Flag: NONE code refactor
Test: Boot and check parameters
Signed-off-by: Will Song <jinpengsong@google.com>

Change-Id: I4ae6407e7edeeed4b62774698b5cb85d32a01c2d
2024-11-22 09:08:08 -08:00
Martin Liu
d6d4a779e5 Move compaction_proactiveness to vendor sepolicy
Move compaction_proactiveness sepolicy from the system
to vendor since it breaks other vendors.

Bug: 361985704
Test: check knob value
Flag: NONE sepolicy doesn't support flag
Change-Id: I14cff8dfe4e143995b9011cd34a1e7d74613ae33
Signed-off-by: Martin Liu <liumartin@google.com>
2024-08-30 07:21:16 +00:00
Pechetty Sravani (xWF)
7eaa70c248 Merge changes from topic "revert-28323508-common_perf_init-ADJDKJXNAW" into main
* changes:
  Revert "gs-common: Added common perf init.rc"
  Revert "gs-common: Move cpufreq perf settings to gs-common"
2024-08-19 06:53:09 +00:00
Pechetty Sravani (xWF)
98e6a61c1f Revert "gs-common: Added common perf init.rc"
Revert submission 28323508-common_perf_init

Reason for revert: Potential culprit for b/360746202- verifying through ABTD before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted.

Reverted changes: /q/submissionid:28323508-common_perf_init

Change-Id: Ic29fb88b0d78974af602ff12456fb39c223c19e7
2024-08-19 05:33:45 +00:00
Pechetty Sravani (xWF)
7606e41504 Revert "gs-common: Move cpufreq perf settings to gs-common"
Revert submission 28323508-common_perf_init

Reason for revert: Potential culprit for b/360746202- verifying through ABTD before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted.

Reverted changes: /q/submissionid:28323508-common_perf_init

Change-Id: I0dd3825e9574b79f761a43edc56f86c060103aeb
2024-08-19 05:33:51 +00:00
Treehugger Robot
71783b1729 Merge changes from topic "common_perf_init" into main
* changes:
  gs-common: Move cpufreq perf settings to gs-common
  gs-common: Added common perf init.rc
2024-08-19 03:55:25 +00:00
Will Song
38522ec23e gs-common: Move cpufreq perf settings to gs-common
Moving common cpufreq perf settings to gs-common

Bug: 335874870
Flag: NONE code refactor
Test: boot and check parameters
Change-Id: I9038a54d782be75d520e611fd93d18b1880ae442
Signed-off-by: Will Song <jinpengsong@google.com>
2024-08-15 16:54:48 -07:00
Will Song
6a77a85f6a gs-common: Added common perf init.rc
Migrate configuratuions from devices setting to common folder
for kernel 6.1 devices.

Bug: 335874870
Flag: NONE code refactor
Test: Boot and check parameters
Change-Id: I3c204c1df36eda67744d085600a95ac8bb696da9
Signed-off-by: Will Song <jinpengsong@google.com>
2024-08-15 16:54:28 -07:00
Will Song
805f6b577c gs-common:performance: Add perf owner file am: 2c5b457e4b am: f14ff6e8dc
Original change: https://android-review.googlesource.com/c/device/google/gs-common/+/3211739

Change-Id: Icc3d1cfa433589e2a3119990f757c0c25dd5dab0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-13 04:13:07 +00:00
Will Song
f14ff6e8dc gs-common:performance: Add perf owner file am: 2c5b457e4b
Original change: https://android-review.googlesource.com/c/device/google/gs-common/+/3211739

Change-Id: Id7325b32068421ed33086cb3e2c11d09e1bef49d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-13 03:53:59 +00:00
Will Song
2c5b457e4b gs-common:performance: Add perf owner file
Bug: 358659371
Change-Id: I23b5033435e1bc240eaabcd4213134195a34d3f8
Test: build
2024-08-09 20:55:42 +00:00
Richard Chang
bf04670197 zram: Ensure 1.5 GB free space before creating zram backing device
fs_mgr follows system property 'ro.zram_backing_device_min_free_mb'
to check available space before creating zram backing device.

Previously, in Repair Mode, it requires at least 2 GB to boot
successfully with 512 MB zram backing device size. So we can set
1.5 GB as the minimum threshold.

Bug: 322821637
Bug: 326877642
Test: Fill up userdata, enlarge zram backing device size on next
boot.
Test: Boot to Repair Mode
Flag: EXEMPT bugfix

Change-Id: I16c6f1649181af94347b4534c790522bfd2fc166
2024-08-05 09:04:34 +00:00
Richard Chang
1a4e01ef9e sepolicy: allow powerhal to access vendor_mm dir
Error log:
auditd  : type=1400 audit(0.0:79): avc:  denied  { search } for  comm="NodeLooperThrea" name="vendor_mm" dev="sysfs" ino=56518 scontext=u:r:hal_power_default:s0 tcontext=u:object_r:sysfs_vendor_mm:s0 tclass=dir permissive=0

Bug: 322916612
Test: check avc logs
Flag: EXEMPT bugfix
Change-Id: I0fa6ba0a11551646d76b65ec764b25cd697d0364
2024-07-15 06:39:22 +00:00
Midas Chien
cd14b2ad4d Dump bts information am: 15538c9845
Original change: https://googleplex-android-review.googlesource.com/c/device/google/gs-common/+/27232582

Change-Id: I07bcaf815b664ab36a17eb19bd5c1ae6238685e2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-15 02:16:45 +00:00
Midas Chien
15538c9845 Dump bts information
Get BTS information when capturing bugreport.

Bug: 335422086
Test: capture bugreport
Change-Id: I5ae9be35a3fc3c975ccc843e9daee6d4e0ac130a
2024-05-14 07:40:58 +00:00
Martin Liu
d400630a10 allow powerhal to access PA_KILL knobs am: 2522590c40
Original change: https://googleplex-android-review.googlesource.com/c/device/google/gs-common/+/27256041

Change-Id: I1e2ae9ee0b8e1744d3be313645c496947b76e7a1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-10 02:00:29 +00:00
Martin Liu
2522590c40 allow powerhal to access PA_KILL knobs
Bug: 322916612
Test: check avc logs
Change-Id: I637c6ad454b668f807b8d0eb4f66a83ca26dfa18
Signed-off-by: Martin Liu <liumartin@google.com>
2024-05-08 08:37:21 +00:00
Martin Liu
3b2fde15ef Move compaction_proactiveness rule to system vendor init
Bug: 330670954
Test: boot
Change-Id: I3cb505a76850c9c3b48d127ae93eb03aa3da33d9
Signed-off-by: Martin Liu <liumartin@google.com>
2024-04-23 08:08:50 +00:00
Martin Liu
d627901103 Set compaction_proactiveness and percpu_pagelist_high_fraction
Move the settings from project's setting to common folder so
the changes can also apply to the following 6.1 kernel.

Bug: 332916849
Bug: 309409009
Test: boot
Change-Id: I89d0386821e8a47301023aa414998dd76e3bd6b9
Signed-off-by: Martin Liu <liumartin@google.com>
2024-04-18 07:10:14 +00:00
Martin Liu
d7125c42db allow vendor init to access MM knob
allow vendor init to access compaction_proactiveness
and percpu_pagelist_high_fraction

Bug: 332916849
Bug: 309409009
Test: boot
Change-Id: Idf83babc3f482ad4183c7287a808904c9608fc10
Signed-off-by: Martin Liu <liumartin@google.com>
2024-04-18 07:09:59 +00:00
Qais Yousef
7b1dcc7981 sepolicy: Add sched_pelt_multiplier node to proc_sched
Add a new genfs_contexts policy for performance that contains the new
label.

Bug: 290305186
Bug: 290189958
Signed-off-by: Qais Yousef <qyousef@google.com>
Change-Id: Ia60ce8f22594a667e722ad2db60afc0f357b571c
2023-07-07 15:07:47 +00:00
Adam Shih
6965958295 add perf dump
Bug: 240530709
Test: adb bugreport
Change-Id: Ie6b4ceb9dcc9daa199927fde56d720816145f344
2023-02-10 13:30:18 +08:00