This is a first try at matching thread names (comm) in addition to the process cmdline for changing scheduling policies and priorities with the `scheduler` plugin. It adds an optional second regex field to the end of `group.*` options (defaults to ".*"). The first regex is to match the process cmdline, the second one is used to match the thread's comm. If both match, scheduling options are applied. Note that you can have multiple `group.*` options with the same process regex and different thread regexes. You can even have one rule to match a specific thread name, and another with no thread regex (matching all threads). In this case you need to assign rule priorities (higher number -> higher priority). Signed-off-by: Adriaan Schmidt <adriaan.schmidt@siemens.com>
62 lines
2 KiB
Text
62 lines
2 KiB
Text
#
|
|
# tuned configuration
|
|
#
|
|
# Dependencies:
|
|
#
|
|
# - tuna
|
|
# - awk
|
|
# - wc
|
|
|
|
[main]
|
|
summary=Optimize for KVM guests running realtime workloads
|
|
include=realtime
|
|
|
|
[variables]
|
|
# User is responsible for adding isolated_cores=X-Y to realtime-virtual-host-variables.conf
|
|
include=/etc/tuned/realtime-virtual-host-variables.conf
|
|
|
|
isolated_cores_assert_check = \\${isolated_cores}
|
|
# Fail if isolated_cores are not set
|
|
assert1=${f:assertion_non_equal:isolated_cores are set:${isolated_cores}:${isolated_cores_assert_check}}
|
|
|
|
isolated_cores_expanded=${f:cpulist_unpack:${isolated_cores}}
|
|
isolated_cores_online_expanded=${f:cpulist_online:${isolated_cores}}
|
|
non_isolated_cores=${f:cpulist_invert:${isolated_cores}}
|
|
|
|
# Fail if isolated_cores contains CPUs which are not online
|
|
assert2=${f:assertion:isolated_cores contains online CPU(s):${isolated_cores_expanded}:${isolated_cores_online_expanded}}
|
|
|
|
[scheduler]
|
|
# group.group_name=rule_priority:scheduler_policy:scheduler_priority:core_affinity_in_hex:process_name_regex[:thread_name_regex]
|
|
# for i in `pgrep ksoftirqd` ; do grep Cpus_allowed_list /proc/$i/status ; done
|
|
group.ksoftirqd=0:f:2:*:^\[ksoftirqd
|
|
group.ktimers=0:f:2:*:^\[ktimers
|
|
|
|
# for i in `pgrep rcuc` ; do grep Cpus_allowed_list /proc/$i/status ; done
|
|
group.rcuc=0:f:4:*:^\[rcuc
|
|
|
|
# for i in `pgrep rcub` ; do grep Cpus_allowed_list /proc/$i/status ; done
|
|
group.rcub=0:f:4:*:^\[rcub
|
|
|
|
# for i in `pgrep ktimersoftd` ; do grep Cpus_allowed_list /proc/$i/status ; done
|
|
group.ktimersoftd=0:f:3:*:^\[ktimersoftd
|
|
|
|
ps_blacklist=^\[ksoftirqd;^\[ktimers;^\[rcuc;^\[rcub;^\[ktimersoftd;pmd;PMD;^DPDK;qemu-kvm
|
|
|
|
[sysfs]
|
|
# Stop kernel same page merge (KSM) daemon, it may introduce latencies.
|
|
#
|
|
# 0: stop ksmd, keep merged pages
|
|
# 1: run ksmd
|
|
# 2: stop ksmd, unmerge all pages
|
|
/sys/kernel/mm/ksm/run = 2
|
|
|
|
# Perform lockless check for timer softirq on isolated CPUs.
|
|
#
|
|
/sys/kernel/ktimer_lockless_check = 1
|
|
|
|
[script]
|
|
script=${i:PROFILE_DIR}/script.sh
|
|
|
|
[bootloader]
|
|
cmdline_rvh=+nohz=on nohz_full=${isolated_cores} rcu_nocbs=${isolated_cores} irqaffinity=${non_isolated_cores}
|