From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: "Ahmed S. Darwish" <darwi@linutronix.de>,
"Rafael J. Wysocki" <rafael@kernel.org>
Cc: Jonathan Corbet <corbet@lwn.net>,
Clark Williams <clrkwllms@kernel.org>,
Steven Rostedt <rostedt@goodmis.org>,
linux-rt-devel@lists.linux.dev,
Matthew Wilcox <willy@infradead.org>,
John Ogness <john.ogness@linutronix.de>,
Derek Barbosa <debarbos@redhat.com>,
linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 1/1] Documentation: real-time: Add kernel configuration guide
Date: Tue, 21 Jul 2026 15:05:33 +0200 [thread overview]
Message-ID: <20260721130533.lK7fkQSc@linutronix.de> (raw)
In-Reply-To: <20260716195716.256025-2-darwi@linutronix.de>
Rafael, any comments from you? Maybe on the CPU FREQ/ IDLE part?
Anything that is missing from your point of view? Here is slim version
of what we already have ;)
On 2026-07-16 21:57:14 [+0200], Ahmed S. Darwish wrote:
> new file mode 100644
> index 000000000000..99dfc73aa4d3
> --- /dev/null
> +++ b/Documentation/core-api/real-time/kernel-configuration.rst
> @@ -0,0 +1,310 @@
> +.. SPDX-License-Identifier: GPL-2.0
> +
> +==============================
> +Real-Time Kernel configuration
> +==============================
> +
> +.. contents:: Table of Contents
> + :depth: 3
> + :local:
> +
> +Introduction
> +============
> +
> +This document lists the kernel configuration options that might affect a
> +real-time kernel's worst-case latency. It is intended for system integrators.
> +
> +Configuration options
> +=====================
> +
> +``CONFIG_CPU_FREQ``
> +-------------------
> +
> +:Expectation: enabled
> +:Severity: *high*
> +
> +The CPU frequency scaling subsystem ensures that the processor can operate
> +at its maximum supported frequency. While, in general, bootloaders are
> +tasked with setting the CPU clock to the highest speed on boot, some do
> +not. It is thus desirable to keep this option enabled.
> +
> +.. caution::
> +
> + A real-time kernel is not about being "as fast as possible", however
> + real-time requirements may demand that the CPU is clocked at a
> + particular speed.
> +
> +``CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE``
> +-------------------------------------------
> +
> +:Expectation: enabled
> +:Severity: *high*
> +
> +Real-Time workloads expect a fixed CPU frequency during execution. Using
> +the performance governor is an easy way to achieve that purely from kernel
> +configuration.
> +
> +This is not a blanket rule. Some setups might prefer to clock the CPU to
> +lower speeds due to thermal packaging or other requirements. The key is
> +that the CPU frequency remains constant once set.
> +
> +``CONFIG_CPU_IDLE``
> +-------------------
> +
> +:Expectation: enabled
> +:Severity: *info*
> +
> +CPU idle states (C-states) allow the processor to enter low-power modes
> +during periods of inactivity. Very-low CPU idle states may require
> +flushing the CPU caches and lowering or disabling the clocking. This can
> +lower power consumption, but it also increases the entry and exit latency
> +from such states.
> +
> +While disabling this option eliminates cpuidle-related latencies, doing so
> +can significantly impact hardware longevity, warranty, and thermal
> +behavior. Users should cap the maximum C-state to C1 instead. For ACPI
> +platforms, this can be achieved by using the boot parameter [1]_::
> +
> + processor.max_cstate=1
> +
> +Higher C-states can be acceptable depending on the user workload's latency
> +requirements. For ACPI-based platforms, use the ``cpupower idle-info``
> +command to inspect the available idle states.
> +
> +For more information, please see:
> +
> +- ``linux/tools/power/cpupower``
> +- :doc:`/admin-guide/pm/cpuidle`
> +- :doc:`/admin-guide/pm/index`
> +
…
> +``CONFIG_NO_HZ`` / ``CONFIG_NO_HZ_FULL``
> +----------------------------------------
> +
> +:Expectation: disabled
> +:Severity: *medium*
> +
> +Tickless operation can increase kernel-to-userspace transition latency due
> +to the extra accounting and state book-keeping.
> +
> +*Guidance by real-time workload type:*
> +
> +- For periodic workloads; e.g., control loops executing every 100 µs, avoid
> + ``NO_HZ`` modes. Consistent kernel ticks are preferable.
> +
> +- For computation-intensive workloads; e.g. extended userspace execution,
> + ``NO_HZ_FULL`` may be beneficial. In such cases, users should offload
> + the kernel housekeeping to dedicated CPUs and isolate compute cores.
> +
> +See also :doc:`/timers/no_hz`.
> +
…
> +
> +Non-performance CPU frequency governors
> +---------------------------------------
> +
> +:Expectation: disabled
> +:Severity: *medium*
> +
> +To ensure reproducible system latency measurements, disable the
> +non-``PERFORMANCE`` CPU frequency governors when possible. This avoids the
> +risk of unknown userspace tasks implicitly or explicitly setting a
> +different CPU frequency governor, and thus achieving different latency
> +results across the system's runtime.
> +
> +If disabling other frequency governors is not an option, then
> +``CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE`` should be enabled. In that case,
> +users should set a *stable* CPU frequency setting during the system
> +runtime, as changing the CPU frequency will increase the system latency and
> +affect latency measurements reproducibility. If a lower CPU frequency is
> +desired, then ``CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE`` should be set.
> +
> +The ``ONDEMAND`` CPU frequency governor should *not* be enabled in a
> +real-time system since it dramatically affects determinism depending on the
> +workload.
> +
> +For more information, please check :doc:`/admin-guide/pm/cpufreq`.
Sebastian
next prev parent reply other threads:[~2026-07-21 13:05 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-16 19:57 [PATCH v4 0/1] Documentation: Add real-time " Ahmed S. Darwish
2026-07-16 19:57 ` [PATCH v4 1/1] Documentation: real-time: Add " Ahmed S. Darwish
2026-07-21 13:02 ` Sebastian Andrzej Siewior
2026-07-21 14:34 ` John Ogness
2026-07-21 14:36 ` Sebastian Andrzej Siewior
2026-07-21 14:48 ` Steven Rostedt
2026-07-21 15:21 ` Sebastian Andrzej Siewior
2026-07-21 15:52 ` John Ogness
2026-07-21 18:08 ` Sebastian Andrzej Siewior
2026-07-22 19:40 ` Ahmed S. Darwish
2026-07-21 13:05 ` Sebastian Andrzej Siewior [this message]
-- strict thread matches above, loose matches on Subject: below --
2026-04-14 17:41 [PATCH v2 0/1] Documentation: Add real-time " Ahmed S. Darwish
2026-04-14 17:41 ` [PATCH v2 1/1] Documentation: real-time: Add " Ahmed S. Darwish
2026-04-14 17:54 ` [PATCH v3 " Ahmed S. Darwish
2026-04-14 18:12 ` [PATCH v4 " Ahmed S. Darwish
2026-05-13 20:42 ` Ahmed S. Darwish
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260721130533.lK7fkQSc@linutronix.de \
--to=bigeasy@linutronix.de \
--cc=clrkwllms@kernel.org \
--cc=corbet@lwn.net \
--cc=darwi@linutronix.de \
--cc=debarbos@redhat.com \
--cc=john.ogness@linutronix.de \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rt-devel@lists.linux.dev \
--cc=rafael@kernel.org \
--cc=rostedt@goodmis.org \
--cc=willy@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®