TUNED-PROFILES-CPU-PARTITIONING(7)

πŸ“¦
version 2.28.0 Β· 2 versions
  • 2.28.0 Β· alpine 3.24, arch rolling, centos-stream 10, centos-stream 9, debian bookworm, debian trixie, fedora 43, fedora 44, nixpkgs unstable, opensuse-leap 16.0, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 2.15.0 Β· ubuntu jammy
, in alpine 3.24, arch rolling, centos-stream 10, centos-stream 9, debian bookworm, debian trixie, fedora 43, fedora 44, nixpkgs unstable, opensuse-leap 16.0, ubuntu noble, ubuntu resolute, ubuntu stonking

TUNED-PROFILES-CPU-PARTITIONING(7) πŸ’–

okay bestie so this is tuned-profiles-cpu-partitioning, a page from the Miscellaneous Information Manual (section 7, iykyk), and it's literally all about splitting your CPUs into the isolated girlies and the housekeeping girlies. no cap. πŸŽ€


✨ NAME ✨

tuned-profiles-cpu-partitioning β€” partition CPUs into isolated and housekeeping. that's it, that's the whole vibe. πŸ’…


🌸 DESCRIPTION 🌸

so the cpu-partitioning* profiles split your system's CPUs into isolated ones and housekeeping ones. these profiles are made for latency-sensitive workloads β€” like, the divas that cannot be interrupted, periodt.

an isolated CPU gets reduced jitter and fewer interruptions from the kernel, and honestly? queen behavior. how does it get that glow-up? by clearing the CPU of user-space processes, movable kernel threads, interruption handlers, kernel timers, etc. the only fixed source of interruptions is the 1Hz tick that the kernel keeps around to maintain CPU usage statistics. everything else β€” any jitter, any interruptions β€” depends on whatever kernel services the thread running on that isolated CPU decides to use. threads that just run a busy loop with no system calls (think user-space drivers that talk to hardware directly) are only expected to get interrupted once a second by that 1Hz tick. iconic.

a housekeeping CPU is literally the opposite of an isolated CPU. housekeeping CPUs run all the daemons, shell processes, kernel threads, interruption handlers, and all the work that can be dispatched off the isolated CPUs β€” disk I/O, RCU work, timers, etc. they're the ones holding the group chat together fr fr. 🫢


πŸ‘‘ PROFILES πŸ‘‘

here's the lineup, bestie:

  • cpu-partitioning β€” profile that partitions the system CPUs into isolated and housekeeping CPUs. the classic. the main character.
  • cpu-partitioning-powersave β€” profile similar to the cpu-partitioning profile, but with more flexibility on the C-states configuration. it's giving flexible πŸ’…

πŸŽ€ CONFIGURATION πŸŽ€

cpu-partitioning

you configure the cpu-partitioning profile by editing the /etc/tuned/cpu-partitioning-variables.conf file. there are two configuration options:

  • isolated_cores=<CPU-LIST> β€” list of CPUs to isolate. this option is mandatory (not optional, not "maybe later", mandatory 😀). any CPUs not in this list are automatically considered a housekeeping CPU.
  • no_balance_cores=<CPU-LIST> β€” list of CPUs that the kernel should not consider when doing system-wide process load-balancing. usually this list should be the same as isolated_cores=. this option is optional.

cpu-partitioning-powersave

the cpu-partitioning-powersave profile is configured by editing the /etc/tuned/cpu-partitioning-powersave-variables.conf file. it supports the same options as the cpu-partitioning profile plus one extra one:

  • max_power_state=<MAX_CSTATE> β€” the maximum c-state the cores are allowed to enter. can be expressed as its name (C1E) or as minimum wake-up latency, in micro-seconds. this parameter is provided as-is to force_latency. default is set to "cstate.name:C1|10" so it behaves like the cpu-partitioning profile. she's consistent, she's reliable. ✨

⚠️ IMPORTANT NOTES ⚠️

  • the system should be rebooted after applying the cpu-partitioning* profiles for the first time, or after changing its configuration. yes, actually reboot. no, closing the laptop lid doesn't count πŸ™ˆ
  • the cpu-partitioning* profiles can be used in bare-metal and virtual machines.
  • when using the cpu-partitioning* profiles in bare-metal, it is strongly recommended to "mask" the ksm and ksmtuned services in systemd (if they're installed). you can do it with this exact command:
# systemctl mask ksm ksmtuned
  • the cpu-partitioning* profiles do not use the kernel's isolcpus= feature. not the vibe, they don't need it.
  • on a NUMA system, it is recommended to have at least one housekeeping CPU per NUMA node. one per node, bestie, don't be stingy πŸ“
  • the cpu-partitioning* profiles do not support isolating the L3 cache. this means a housekeeping CPU can still thrash cache entries pertaining to isolated CPUs 😭 to fix this, it's recommended to use cache isolation technologies, such as Intel's Cache Allocation Technology.
  • whether or not the kernel is going to be able to deactivate the tick on isolated CPUs depends on a few factors concerning the running thread behavior. please consult the nohz_full documentation in the kernel to learn more. do your reading, it's giving studious πŸ“š
  • the Linux real-time project has put together a document on the best practices for writing real-time applications. even though the cpu-partitioning* profiles do not guarantee real-time response time, a lot of the techniques for writing real-time applications also apply to applications intended to run under the cpu-partitioning* profiles. please refer to this document at https://rt.wiki.kernel.org

πŸ“‚ FILES πŸ“‚

  • /etc/tuned/cpu-partitioning-variables.conf
  • /etc/tuned/cpu-partitioning-powersave-variables.conf
  • /etc/tuned/tuned-main.conf

πŸ”— SEE ALSO πŸ”—

tuned(8) tuned-adm(8) tuned-profiles(7) tuned-profiles-atomic(7) tuned-profiles-sap(7) tuned-profiles-sap-hana(7) tuned-profiles-mssql(7) tuned-profiles-oracle(7) tuned-profiles-realtime(7) tuned-profiles-nfv-host(7) tuned-profiles-nfv-guest(7) tuned-profiles-compat(7) tuned-profiles-postgresql(7) tuned-profiles-openshift(7) tuned-profiles-spectrumscale-ece(7)

like, go read those too, the whole friend group ate πŸ’œ


πŸ’– AUTHOR πŸ’–

  • Jaroslav Ε karvada <jskarvad@redhat.com>
  • Luiz Capitulino <lcapitulino@redhat.com>
  • Andrew Theurer <atheurer@redhat.com>

this whole thing is part of TuneD, dated 22 Feb 2018. thanks for coming to my TED talk bestie, now go isolate those cores and slay πŸ’…βœ¨πŸ¦‹