From d59a43e25217c44be727d2c32c61340d1b2cd820 Mon Sep 17 00:00:00 2001 From: Leonardo Graboski Veiga Date: Thu, 21 Mar 2024 08:14:22 -0300 Subject: [PATCH] xenomai: tune kernel config for low latency In the Xenomai docs and also on Intel ECI docs, there are comments on kernel config that help with low latency, which improves the real-time reliability and performance. From https://v4.xenomai.org/dovetail/rulesofthumb/: * CONFIG_DEBUG_IRQ_PIPELINE and CONFIG_DEBUG_DOVETAIL are helpful to keep the development process sane. * CONFIG_RAW_PRINTK is useful and recommended for debugging Xenomai out-of-band issues. From https://v4.xenomai.org/core/user-api/scheduling/: * CONFIG_EVL_SCHED_QUOTA and CONFIG_EVL_SCHED_TP enabled to give users more scheduler options for the Xenomai out-of-band scheduler. From https://eci.intel.com/docs/3.1/appendix.html#eci-kernel-configuration-optimizations: * CONFIG_NO_HZ and CPU_FREQ_STAT disabled to reduce task scheduling clock overhead. * CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE enabled as default to prevent the CPU governor from throttling the CPU frequency for power-saving. * CONFIG_SUSPEND and CONFIG_PM disabled to prevent power management features to introduce spikes to latency. * CONFIG_VIRT_CPU_ACCOUNTING and CONFIG_VIRT_CPU_ACCOUNTING_GEN for more accurate task and CPU time accounting. * CONFIG_RCU_NOCB_CPU for CPU temporal isolation. Each config in this commit was enabled individually and tested for 5 minutes under stress, using the Scary Grinder workload as defined on the doc https://v4.xenomai.org/core/benchmarks/#stress-workloads A final stress test was run for 3 hours. This is the same idea as the "EVL stress" test defined on https://v4.xenomai.org/ports/, except it was not run for 24h. Signed-off-by: Leonardo Graboski Veiga --- recipes-kernel/linux/files/xenomai.cfg | 41 ++++++++++++++++++++++++-- 1 file changed, 39 insertions(+), 2 deletions(-) diff --git a/recipes-kernel/linux/files/xenomai.cfg b/recipes-kernel/linux/files/xenomai.cfg index a34696b7..9da73683 100644 --- a/recipes-kernel/linux/files/xenomai.cfg +++ b/recipes-kernel/linux/files/xenomai.cfg @@ -3,12 +3,38 @@ # CONFIG_IRQ_PIPELINE=y +# +# Timers subsystem +# +CONFIG_CONTEXT_TRACKING=y +# CONFIG_CONTEXT_TRACKING_FORCE is not set +CONFIG_NO_HZ=n + +# +# CPU/Task time and stats accounting +# +CONFIG_VIRT_CPU_ACCOUNTING=y +# CONFIG_TICK_CPU_ACCOUNTING is not set +CONFIG_VIRT_CPU_ACCOUNTING_GEN=y + +# +# RCU Subsystem +# +CONFIG_RCU_EXPERT=y +CONFIG_RCU_FANOUT=64 +CONFIG_RCU_FANOUT_LEAF=16 +# CONFIG_RCU_FAST_NO_HZ is not set +# CONFIG_RCU_BOOST is not set +CONFIG_RCU_NOCB_CPU=y +# CONFIG_TASKS_TRACE_RCU_READ_MB is not set + # # Processor type and features # CONFIG_EVL=y -# CONFIG_EVL_SCHED_QUOTA is not set -# CONFIG_EVL_SCHED_TP is not set +CONFIG_EVL_SCHED_QUOTA=y +CONFIG_EVL_SCHED_TP=y +CONFIG_EVL_SCHED_TP_NR_PART=4 # CONFIG_EVL_HIGH_PERCPU_CONCURRENCY is not set CONFIG_EVL_RUNSTATS=y # CONFIG_EVL_NET is not set @@ -37,6 +63,12 @@ CONFIG_EVL_LATENCY_IRQ=0 CONFIG_DOVETAIL=y CONFIG_DOVETAIL_LEGACY_SYSCALL_RANGE=y +# +# Power management and ACPI options +# +CONFIG_SUSPEND=n +CONFIG_PM=n + # # CPU Frequency scaling # @@ -51,3 +83,8 @@ CONFIG_CPU_FREQ_GOV_ONDEMAND=n CONFIG_EVL_LATMUS=y CONFIG_EVL_HECTIC=y # end of Out-of-band device drivers + +CONFIG_DEBUG_IRQ_PIPELINE=y +# CONFIG_IRQ_PIPELINE_TORTURE_TEST is not set +CONFIG_DEBUG_DOVETAIL=y +CONFIG_RAW_PRINTK=y \ No newline at end of file