From eef5409df4c3f1192687eaa6157875e4650c1206 Mon Sep 17 00:00:00 2001 From: Tomeu Vizoso Date: Thu, 19 Nov 2020 17:01:41 +0100 Subject: [PATCH] ci: Configure DUTs for max performance Lock CPU and GPU frequency scaling on devices so to speed up test execution and lower the variation of frame times from performance replay jobs. Also disable autosuspend of the GPU device. Signed-off-by: Tomeu Vizoso Reviewed-By: Rohan Garg Part-of: --- .gitlab-ci/bare-metal/init.sh | 17 +++++++++++++++++ .gitlab-ci/lava.yml.jinja2 | 5 +++++ 2 files changed, 22 insertions(+) diff --git a/.gitlab-ci/bare-metal/init.sh b/.gitlab-ci/bare-metal/init.sh index 044c042..f04dde9 100755 --- a/.gitlab-ci/bare-metal/init.sh +++ b/.gitlab-ci/bare-metal/init.sh @@ -46,6 +46,23 @@ if [ -n "$BM_START_XORG" ]; then export DISPLAY=:0 fi +# Disable GPU frequency scaling +DEVFREQ_GOVERNOR=`find /sys/devices -name governor | grep gpu || true` +echo performance > $DEVFREQ_GOVERNOR || true + +# Disable CPU frequency scaling +echo performance | tee -a /sys/devices/system/cpu/cpufreq/policy*/scaling_governor || true + +# The below would be generally useful, but a bug in drm/msm leaves the GPU +# device in a broken state if we try to do it before the first client (Xorg +# in this case) connects. +# TODO: Make it inconditional once https://gitlab.freedesktop.org/drm/msm/-/issues/5 is solved in Mesa CI's kernel +if [ -n "$BM_START_XORG" ]; then + # Disable GPU runtime PM + GPU_AUTOSUSPEND=`find /sys/devices -name autosuspend_delay_ms | grep gpu | head -1` + echo -1 > $GPU_AUTOSUSPEND || true +fi + if sh $BARE_METAL_TEST_SCRIPT; then OK=1 else diff --git a/.gitlab-ci/lava.yml.jinja2 b/.gitlab-ci/lava.yml.jinja2 index e8c74aa..e9735d6 100644 --- a/.gitlab-ci/lava.yml.jinja2 +++ b/.gitlab-ci/lava.yml.jinja2 @@ -82,9 +82,14 @@ actions: - modprobe amdgpu || true + # Disable GPU frequency scaling - DEVFREQ_GOVERNOR=`find /sys/devices -name governor | grep gpu || true` - echo performance > $DEVFREQ_GOVERNOR || true + # Disable CPU frequency scaling + - echo performance | tee -a /sys/devices/system/cpu/cpufreq/policy*/scaling_governor || true + + # Disable GPU runtime PM - GPU_AUTOSUSPEND=`find /sys/devices -name autosuspend_delay_ms | grep gpu | head -1` - echo -1 > $GPU_AUTOSUSPEND || true -- 2.7.4