1
0
Fork 0

Merge branch 'master' into project-rename

This commit is contained in:
Jaroslav Škarvada 2021-06-03 17:20:55 +02:00 committed by GitHub
commit 78df85affe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 123 additions and 50 deletions

View file

@ -1,21 +1,20 @@
downstream_package_name: tuned
upstream_tag_template: v{version}
jobs:
- job: copr_build
trigger: pull_request
metadata:
targets:
- fedora-all
- epel-8-x86_64
- centos-stream-x86_64
trigger: pull_request
- centos-stream-8-x86_64
- job: tests
trigger: pull_request
metadata:
targets:
- fedora-all
- epel-8-x86_64
- centos-stream-x86_64
specfile_path: tuned.spec
- centos-stream-8-x86_64
synced_files:
- tuned.spec
- .packit.yaml
upstream_package_name: tuned

2
ci.fmf
View file

@ -1,4 +1,4 @@
discover:
how: fmf
execute:
how: beakerlib
how: tmt

View file

@ -24,20 +24,36 @@ That is why the `balanced` profile can be generally a better option.
`throughput-performance`::
A server profile optimized for high throughput. It disables power savings mechanisms and enables `sysctl` settings that improve the throughput performance of the disk and network IO. CPU governor is set to `performance`.
`accelerator-performance`::
The `accelerator-performance` profile contains the same tuning as the `throughput-performance` profile. Additionally, it locks the CPU to low C states so that the latency is less than 100us. This improves the performance of certain accelerators, such as GPUs.
`latency-performance`::
A server profile optimized for low latency. It disables power savings mechanisms and enables `sysctl` settings that improve latency. CPU governor is set to `performance` and the CPU is locked to the low C states (by PM QoS).
+
It changes the `energy_performance_preference` and `scaling_governor` attribute to the `performance` profile.
`network-latency`::
A profile for low latency network tuning. It is based on the `latency-performance` profile. It additionally disables transparent huge pages and NUMA balancing, and tunes several other network-related `sysctl` parameters.
+
It inherits the `latency-performance` profile which changes the `energy_performance_preference` and `scaling_governor` attribute to the `performance` profile.
`hpc-compute`::
A profile optimized for high-performance computing. It is based on the `latency-performance` profile.
`network-throughput`::
A profile for throughput network tuning. It is based on the `throughput-performance` profile. It additionally increases kernel network buffers.
+
It inherits either the `latency-performance` or `throughput-performance` profile, and changes the `energy_performance_preference` and `scaling_governor` attribute to the `performance` profile.
`virtual-guest`::
A profile designed for virtual guests based on the `throughput-performance` profile that, among other tasks, decreases virtual memory swappiness and increases disk readahead values. It does not disable disk barriers.
+
It inherits the `throughput-performance` profile and changes the `energy_performance_preference` and `scaling_governor` attribute to the `performance` profile.
`virtual-host`::
A profile designed for virtual hosts based on the `throughput-performance` profile that, among other tasks, decreases virtual memory swappiness, increases disk readahead values, and enables a more aggressive value of dirty pages writeback.
+
It inherits the `throughput-performance` profile and changes the `energy_performance_preference` and `scaling_governor` attribute to the `performance` profile.
`oracle`::
A profile optimized for Oracle databases loads based on `throughput-performance` profile. It additionally disables transparent huge pages and modifies other performance-related kernel parameters. This profile is provided by the [package]`tuned-profiles-oracle` package.
@ -60,9 +76,31 @@ You can configure the `cpu-partitioning` profile in `/etc/tuned/cpu-partitioning
+
For more information on `cpu-partitioning`, see the `tuned-profiles-cpu-partitioning(7)` man page.
`optimize-serial-console`::
A profile that tunes down I/O activity to the serial console by reducing the
printk value. This should make the serial console more responsive.
This profile is intended to be used as an overlay on other
profiles. For example:
+
[subs=+quotes]
----
# tuned-adm profile throughput-performance optimize-serial-console
----
`mssql`::
A profile provided for Microsoft SQL Server. It is based on the `thoguhput-performance` profile.
`postgresql`::
A profile optimized for PostgreSQL databases loads based on `throughput-performance` profile. It additionally disables transparent huge pages and modifies other performance-related kernel parameters. This profile is provided by the [package]`tuned-profiles-postgresql` package.
`intel-sst`::
A profile optimized for systems with user-defined Intel Speed Select Technology configurations. This profile is intended to be used as an overlay on other profiles. For example:
+
[subs=+quotes]
----
# tuned-adm profile cpu-partitioning intel-sst
----
[discrete]
== Real-time profiles
@ -84,4 +122,3 @@ Provided by the [package]`tuned-profiles-nfv-host` package, which is available f
Use in a virtualization guest configured for real-time.
+
Provided by the [package]`tuned-profiles-nfv-guest` package, which is available from the NFV repository.

View file

@ -4,7 +4,7 @@ type getargs >/dev/null 2>&1 || . /lib/dracut-lib.sh
cpumask="$(getargs tuned.non_isolcpus)"
file=/sys/devices/virtual/workqueue/cpumask
files=$(echo /sys/devices/virtual/workqueue{/,/*/}cpumask)
log()
{
@ -12,8 +12,12 @@ log()
}
if [ -n "$cpumask" ]; then
log "setting workqueue CPU mask to $cpumask"
if ! echo $cpumask > $file 2>/dev/null; then
log "ERROR: could not write workqueue CPU mask"
fi
log "setting workqueues CPU mask to $cpumask"
for f in $files; do
if [ -f $f ]; then
if ! echo $cpumask > $f 2>/dev/null; then
log "ERROR: could not write workqueue CPU mask '$cpumask' to '$f'"
fi
fi
done
fi

View file

@ -44,6 +44,7 @@ kernel.timer_migration = 0
[sysfs]
/sys/bus/workqueue/devices/writeback/cpumask = ${not_isolated_cpumask}
/sys/devices/virtual/workqueue/cpumask = ${not_isolated_cpumask}
/sys/devices/virtual/workqueue/*/cpumask = ${not_isolated_cpumask}
/sys/devices/system/machinecheck/machinecheck*/ignore_ce = 1
[systemd]

View file

@ -2,13 +2,8 @@
. /usr/lib/tuned/functions
KTIMER_LOCKLESS_FILE=/sys/kernel/ktimer_lockless_check
start() {
if [ -f $KTIMER_LOCKLESS_FILE ]; then
echo 1 > $KTIMER_LOCKLESS_FILE
fi
return "$?"
return 0
}
stop() {
@ -16,7 +11,7 @@ stop() {
}
verify() {
return "$?"
return 0
}
process $@

View file

@ -36,6 +36,11 @@ group.ktimersoftd=0:f:3:*:ktimersoftd.*
ps_blacklist=ksoftirqd.*;rcuc.*;rcub.*;ktimersoftd.*
[sysfs]
# Perform lockless check for timer softirq on isolated CPUs.
#
/sys/kernel/ktimer_lockless_check = 1
[script]
script=${i:PROFILE_DIR}/script.sh

View file

@ -2,36 +2,39 @@
. /usr/lib/tuned/functions
KTIMER_LOCKLESS_FILE=/sys/kernel/ktimer_lockless_check
start() {
setup_kvm_mod_low_latency
disable_ksm
if [ -f $KTIMER_LOCKLESS_FILE ]; then
echo 1 > $KTIMER_LOCKLESS_FILE
fi
return 0
}
stop() {
if [ "$1" = "full_rollback" ]; then
teardown_kvm_mod_low_latency
enable_ksm
fi
return "$?"
}
verify() {
retval=0
# set via /etc/modprobe.d/kvm.conf and /etc/modprobe.d/kvm.rt.tuned.conf
if [ -f /sys/module/kvm/parameters/kvmclock_periodic_sync ]; then
test "$(cat /sys/module/kvm/parameters/kvmclock_periodic_sync)" = 0
retval=$?
kps=$(cat /sys/module/kvm/parameters/kvmclock_periodic_sync)
if [ "$kps" = "N" -o "$kps" = "0" ]; then
echo " kvmclock_periodic_sync:($kps): disabled: okay"
else
echo " kvmclock_periodic_sync:($kps): enabled: expected N(0)"
retval=1
fi
fi
if [ $retval -eq 0 -a -f /sys/module/kvm_intel/parameters/ple_gap ]; then
test "$(cat /sys/module/kvm_intel/parameters/ple_gap)" = 0
retval=$?
if [ -f /sys/module/kvm_intel/parameters/ple_gap ]; then
ple_gap=$(cat /sys/module/kvm_intel/parameters/ple_gap)
if [ $ple_gap -eq 0 ]; then
echo " ple_gap:($ple_gap): disabled: okay"
else
echo " ple_gap:($ple_gap): enabled: expected 0"
retval=1
fi
fi
return $retval
}

View file

@ -41,6 +41,18 @@ group.ktimersoftd=0:f:3:*:ktimersoftd.*
ps_blacklist=ksoftirqd.*;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

View file

@ -11,8 +11,12 @@ stop() {
}
verify() {
tuna -c "$TUNED_isolated_cores" -P
return "$?"
retval=0
if [ "$TUNED_isolated_cores" ]; then
tuna -c "$TUNED_isolated_cores" -P > /dev/null 2>&1
retval=$?
fi
return $retval
}
process $@

View file

@ -48,6 +48,7 @@ kernel.timer_migration = 0
[sysfs]
/sys/bus/workqueue/devices/writeback/cpumask = ${not_isolated_cpumask}
/sys/devices/virtual/workqueue/cpumask = ${not_isolated_cpumask}
/sys/devices/virtual/workqueue/*/cpumask = ${not_isolated_cpumask}
/sys/devices/system/machinecheck/machinecheck*/ignore_ce = 1
[bootloader]

View file

@ -7,3 +7,4 @@ duration: 20m
relevancy: |
distro = rhel-4, rhel-5, rhel-6: False
summary: Test for BZ#1688371 (Program tuned tried to access /dev/mem between)
framework: beakerlib

View file

@ -7,3 +7,4 @@ duration: 20m
relevancy: |
distro = rhel-4, rhel-5, rhel-6: False
summary: Test for BZ#1663412 (TuneD takes too long to reload/start when \"ulimit)
framework: beakerlib

View file

@ -10,3 +10,4 @@ require:
- tuned
duration: 5m
extra-task: /CoreOS/tuned/Regression/bz1798183-RFE-support-post-loaded-profile
framework: beakerlib

View file

@ -37,12 +37,14 @@ SWAPPINESS=vm.swappiness
DIRTY_RATIO=vm.dirty_ratio
PID_FILE=/run/tuned/tuned.pid
SERVICE_OVERRIDE_DIR=/etc/systemd/system/tuned.service.d
PYTHON_CHECK="python3 /usr/libexec/platform-python python2 python"
PYTHON=python3
function wait_for_tuned()
{
local timeout=$1
local elapsed=0
while ! python3 -c 'import dbus; bus = dbus.SystemBus(); exit(0 if bus.name_has_owner("com.redhat.tuned") else 1)'; do
while ! $PYTHON -c 'import dbus; bus = dbus.SystemBus(); exit(0 if bus.name_has_owner("com.redhat.tuned") else 1)'; do
sleep 1
elapsed=$(($elapsed + 1))
if [ "$elapsed" -ge "$timeout" ]; then
@ -70,6 +72,7 @@ function wait_for_tuned_stop()
rlJournalStart
rlPhaseStartSetup
rlAssertRpm $PACKAGE
rlRun "for PYTHON in $PYTHON_CHECK; do \$PYTHON --version 2>/dev/null && break; done" 0 "Detect python"
rlRun "rlFileBackup --clean $PROFILE_DIR"
rlRun "cp -r parent $PROFILE_DIR"
rlRun "cp -r parent2 $PROFILE_DIR"
@ -108,7 +111,7 @@ rlJournalStart
rlRun "rlServiceStart tuned"
rlRun "echo parent2 > $ACTIVE_PROFILE"
rlRun "echo post2 > $POST_LOADED_PROFILE"
timeout 25s python3 ./wait_for_signal.py &
timeout 25s $PYTHON ./wait_for_signal.py &
pid=$!
# Give the wait_for_signal script a chance to connect to the bus
sleep 1
@ -173,7 +176,7 @@ rlJournalStart
rlRun "rlServiceStart tuned"
rlAssertEquals "Check the output of tuned-adm active" \
"$(tuned-adm active)" \
"Current active profile: post"
"Current active profile: post"$'\n'"Current post-loaded profile: post"
rlAssertEquals "Check that dirty ratio is set correctly" \
"$(sysctl -n $DIRTY_RATIO)" 8
rlPhaseEnd
@ -209,7 +212,7 @@ rlJournalStart
rlRun "rlServiceStop tuned"
rlRun "echo parent > $ACTIVE_PROFILE"
rlRun "echo post > $POST_LOADED_PROFILE"
timeout 25s python3 ./wait_for_signal.py > output &
timeout 25s $PYTHON ./wait_for_signal.py > output &
pid=$!
# If the 'wait $pid' command below fails but everything else
# in this phase succeeds, try adding a sleep here.
@ -219,7 +222,7 @@ rlJournalStart
"$(< output)" \
"parent"
timeout 25s python3 ./wait_for_signal.py > output &
timeout 25s $PYTHON ./wait_for_signal.py > output &
pid=$!
rlRun "tuned-adm profile parent"
rlRun "wait $pid"

View file

@ -7,3 +7,4 @@ duration: 5m
relevancy: |
distro = rhel-4, rhel-5: False
summary: Test for BZ#1416712 (TuneD logs error message if)
framework: beakerlib

View file

@ -7,3 +7,4 @@ relevancy: |
distro = rhel-6: False
distro < rhel-7.3: False
summary: Check functionality of tuned-adm tool.
framework: beakerlib

View file

@ -94,9 +94,14 @@ Recommends: hdparm
Recommends: kernel-tools
Recommends: kmod
%endif
# syspurpose
%if 0%{?rhel} > 8
Requires: subscription-manager
%else
%if 0%{?rhel} > 7
Requires: python3-syspurpose
%endif
%endif
%description
The tuned package contains a daemon that tunes system settings dynamically.

View file

@ -18,7 +18,7 @@ class DeviceMatcherUdev(device_matcher.DeviceMatcher):
except AttributeError:
items = device.items()
for key, val in list(items):
for key, val in sorted(list(items)):
properties += key + '=' + val + '\n'
return re.search(regex, properties, re.MULTILINE) is not None

View file

@ -397,7 +397,7 @@ class NetTuningPlugin(base.Plugin):
if dev_params:
self._check_device_support(context, d, device, dev_params)
# replace the channel parameters based on the device support
if context == "channels" and int(dev_params[next(iter(d))]) == 0:
if context == "channels" and (int(dev_params[next(iter(d))]) == 0 or str(dev_params[next(iter(d))]) == 'n/a'):
d = self._replace_channels_parameters(context, self._cmd.dict2list(d), dev_params)
if not sim and len(d) != 0:
@ -416,12 +416,14 @@ class NetTuningPlugin(base.Plugin):
if start:
params_current = self._get_device_parameters(context,
device)
if params_current is None or len(params_current) == 0:
return False
params_set = self._set_device_parameters(context,
value, device, verify,
dev_params = params_current)
# if none of parameters passed checks then the command completely
# failed
if len(params_set) == 0:
if params_set is None or len(params_set) == 0:
return False
relevant_params_current = [(param, value) for param, value
in params_current.items()

View file

@ -91,11 +91,8 @@ class ProfileRecommender:
elif option == "chassis_type":
chassis_type = self._get_chassis_type()
if chassis_type:
if not re.match(value, chassis_type, re.IGNORECASE):
match = False
else:
log.debug("Ignoring 'chassis_type' in '%s', could not read DMI value." % fname)
if not re.match(value, chassis_type, re.IGNORECASE):
match = False
elif option == "syspurpose_role":
if have_syspurpose:
s = syspurpose.files.SyspurposeStore(