Commit db6947da authored by Jaroslav Škarvada's avatar Jaroslav Škarvada

profiles: added new profile cpu-partitioning

The profile is delivered in the new tuned-profiles-cpu-partitioning subpackage.
Also moved defirqaffinity.py to the base package to allow other profiles
to use it.

Resolves: rhbz#1359956
Signed-off-by: default avatarJaroslav Škarvada <jskarvad@redhat.com>
parent bfc62148
......@@ -129,6 +129,8 @@ install: install-dirs
$(DESTDIR)/etc/tuned/realtime-virtual-guest-variables.conf
mv $(DESTDIR)$(TUNED_PROFILESDIR)/realtime-virtual-host/realtime-virtual-host-variables.conf \
$(DESTDIR)/etc/tuned/realtime-virtual-host-variables.conf
mv $(DESTDIR)$(TUNED_PROFILESDIR)/cpu-partitioning/cpu-partitioning-variables.conf \
$(DESTDIR)/etc/tuned/cpu-partitioning-variables.conf
install -pm 0644 recommend.conf $(DESTDIR)$(TUNED_PROFILESDIR)/recommend.conf
# bash completion
......
......@@ -55,6 +55,7 @@ netfilter connections tracking.
.BR tuned\-profiles\-oracle (7)
.BR tuned\-profiles\-realtime (7)
.BR tuned\-profiles\-nfv (7)
.BR tuned\-profiles\-cpu\-partitioning (7)
.BR tuned\-profiles\-compat (7)
.SH AUTHOR
.NF
......
......@@ -89,6 +89,7 @@ set to performance.
.BR tuned\-profiles\-oracle (7)
.BR tuned\-profiles\-realtime (7)
.BR tuned\-profiles\-nfv (7)
.BR tuned\-profiles\-cpu\-partitioning (7)
.SH AUTHOR
.NF
Jaroslav Škarvada <jskarvad@redhat.com>
......
.\"/*
.\" * All rights reserved
.\" * Copyright (C) 2015 Red Hat, Inc.
.\" * Authors: Jaroslav Škarvada
.\" *
.\" * This program is free software; you can redistribute it and/or
.\" * modify it under the terms of the GNU General Public License
.\" * as published by the Free Software Foundation; either version 2
.\" * of the License, or (at your option) any later version.
.\" *
.\" * This program is distributed in the hope that it will be useful,
.\" * but WITHOUT ANY WARRANTY; without even the implied warranty of
.\" * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
.\" * GNU General Public License for more details.
.\" *
.\" * You should have received a copy of the GNU General Public License
.\" * along with this program; if not, write to the Free Software
.\" * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
.\" */
.\"
.TH TUNED_PROFILES_CPU_PARTITIONING "7" "7 Oct 2016" "tuned"
.SH NAME
tuned\-profiles\-cpu\-partitioning - description of profile provided for for CPU partitioning
.SH DESCRIPTION
The profile is provided for CPU partitioning.
.SH PROFILES
The following profiles is provided:
.TP
.BI "cpu\-partitioning"
Profile optimized for CPU partitioning.
.SH "FILES"
.NF
.I /etc/tuned/*
.I /usr/lib/tuned/*
.SH "SEE ALSO"
.BR tuned (8)
.BR tuned\-adm (8)
.BR tuned\-profiles (7)
.BR tuned\-profiles\-atomic (7)
.BR tuned\-profiles\-sap (7)
.BR tuned\-profiles\-sap\-hana (7)
.BR tuned\-profiles\-oracle (7)
.BR tuned\-profiles\-realtime (7)
.BR tuned\-profiles\-nfv (7)
.BR tuned\-profiles\-compat (7)
.SH AUTHOR
.NF
Jaroslav Škarvada <jskarvad@redhat.com>
......@@ -50,6 +50,7 @@ Profile optimized for virtual hosts based on realtime profile.
.BR tuned\-profiles\-sap\-hana (7)
.BR tuned\-profiles\-oracle (7)
.BR tuned\-profiles\-realtime (7)
.BR tuned\-profiles\-cpu\-partitioning (7)
.BR tuned\-profiles\-compat (7)
.SH AUTHOR
.NF
......
......@@ -48,6 +48,7 @@ performance related kernel parameters.
.BR tuned\-profiles\-atomic (7)
.BR tuned\-profiles\-realtime (7)
.BR tuned\-profiles\-nfv (7)
.BR tuned\-profiles\-cpu\-partitioning (7)
.BR tuned\-profiles\-compat (7)
.SH AUTHOR
.NF
......
......@@ -46,6 +46,7 @@ Profile optimized for realtime.
.BR tuned\-profiles\-sap\-hana (7)
.BR tuned\-profiles\-oracle (7)
.BR tuned\-profiles\-nfv (7)
.BR tuned\-profiles\-cpu\-partitioning (7)
.BR tuned\-profiles\-compat (7)
.SH AUTHOR
.NF
......
......@@ -57,6 +57,7 @@ recieve offload for the network adapter.
.BR tuned\-profiles\-oracle (7)
.BR tuned\-profiles\-realtime (7)
.BR tuned\-profiles\-nfv (7)
.BR tuned\-profiles\-cpu-partitioning (7)
.BR tuned\-profiles\-compat (7)
.SH AUTHOR
.NF
......
......@@ -49,6 +49,7 @@ areas a process may have.
.BR tuned\-profiles\-oracle (7)
.BR tuned\-profiles\-realtime (7)
.BR tuned\-profiles\-nfv (7)
.BR tuned\-profiles\-cpu\-partitioning (7)
.BR tuned\-profiles\-compat (7)
.SH AUTHOR
.NF
......
......@@ -125,6 +125,7 @@ It additionally enables more aggresive writeback of dirty pages.
.BR tuned\-profiles\-oracle (7)
.BR tuned\-profiles\-realtime (7)
.BR tuned\-profiles\-nfv (7)
.BR tuned\-profiles\-cpu\-partitioning (7)
.BR tuned\-profiles\-compat (7)
.SH AUTHOR
.NF
......
# Examples:
# isolated_cores=2,4-7
# isolated_cores=2-23
#
#!/bin/sh
. /usr/lib/tuned/functions
start() {
python /usr/libexec/tuned/defirqaffinity.py "remove" "$TUNED_isolated_cores_expanded" &&
tuna -c "$TUNED_isolated_cores_expanded" -i
sed -i '/^IRQBALANCE_BANNED_CPUS=/d' /etc/sysconfig/irqbalance
echo "IRQBALANCE_BANNED_CPUS=$TUNED_isolated_cpumask" >>/etc/sysconfig/irqbalance
return "$?"
}
stop() {
tuna -c "$TUNED_isolated_cores_expanded" -I &&
python /usr/libexec/tuned/defirqaffinity.py "add" "$TUNED_isolated_cores_expanded"
if [ "$1" = "profile_switch" ]
then
sed -i '/^IRQBALANCE_BANNED_CPUS=/d' /etc/sysconfig/irqbalance
fi
return "$?"
}
verify() {
python /usr/libexec/tuned/defirqaffinity.py "verify" "$TUNED_isolated_cores_expanded"
return "$?"
}
process $@
# tuned configuration
#
[main]
summary=Optimize for CPU partitioning
include=network-latency
[variables]
# User is responsible for updating variables.conf with variable content such as isolated_cores=X-Y
include=/etc/tuned/cpu-partitioning-variables.conf
# Non-isolated cores cpumask including offline cores
isolated_cores_expanded=${f:cpulist_unpack:${isolated_cores}}
isolated_cpumask=${f:cpulist2hex:${isolated_cores_expanded}}
not_isolated_cores_expanded=${f:cpulist_invert:${isolated_cores_expanded}}
isolated_cores_present_expanded=${f:cpulist_present:${isolated_cores}}
not_isolated_cores_present_expanded=${f:cpulist_present:${not_isolated_cores_expanded}}
not_isolated_cpumask=${f:cpulist2hex:${not_isolated_cores_expanded}}
# Fail if isolated_cores contains CPUs which are not present
assert=${f:assertion:isolated_cores contains present CPU(s):${isolated_cores_expanded}:${isolated_cores_present_expanded}}
[sysctl]
kernel.hung_task_timeout_secs = 600
kernel.nmi_watchdog = 0
vm.stat_interval = 10
kernel.timer_migration = 0
[sysfs]
/sys/bus/workqueue/devices/writeback/cpumask = ${not_isolated_cpumask}
/sys/devices/virtual/workqueue/cpumask = ${not_isolated_cpumask}
/sys/devices/system/machinecheck/machinecheck*/ignore_ce = 1
[script]
script=script.sh
[systemd]
cpu_affinity=${not_isolated_cores_expanded}
[bootloader]
cmdline= nohz=on nohz_full=${isolated_cores} rcu_nocbs=${isolated_cores} intel_pstate=disable nosoftlockup
......@@ -113,6 +113,14 @@ Requires: tuna, qemu-kvm-tools-rhev
%description profiles-nfv
Additional tuned profile(s) targeted to Network Function Virtualization (NFV).
%package profiles-cpu-partitioning
Summary: Additional tuned profile(s) optimized for CPU partitioning
Requires: %{name} = %{version}-%{release}
Requires: tuna
%description profiles-cpu-partitioning
Additional tuned profile(s) optimized for CPU partitioning.
%package profiles-compat
Summary: Additional tuned profiles mainly for backward compatibility with tuned 1.0
Requires: %{name} = %{version}-%{release}
......@@ -226,6 +234,9 @@ fi
%{_sbindir}/tuned
%{_sbindir}/tuned-adm
%exclude %{_sysconfdir}/tuned/realtime-variables.conf
%exclude %{_sysconfdir}/tuned/realtime-virtual-guest-variables.conf
%exclude %{_sysconfdir}/tuned/realtime-virtual-host-variables.conf
%exclude %{_sysconfdir}/tuned/cpu-partitioning-variables.conf
%exclude %{_prefix}/lib/tuned/default
%exclude %{_prefix}/lib/tuned/desktop-powersave
%exclude %{_prefix}/lib/tuned/laptop-ac-powersave
......@@ -242,9 +253,11 @@ fi
%exclude %{_prefix}/lib/tuned/realtime
%exclude %{_prefix}/lib/tuned/realtime-virtual-guest
%exclude %{_prefix}/lib/tuned/realtime-virtual-host
%exclude %{_prefix}/lib/tuned/cpu-partitioning
%{_prefix}/lib/tuned
%dir %{_sysconfdir}/tuned
%dir %{_libexecdir}/tuned
%{_libexecdir}/tuned/defirqaffinity*
%config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/tuned/active_profile
%config(noreplace) %{_sysconfdir}/tuned/tuned-main.conf
%config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/tuned/bootcmdline
......@@ -325,9 +338,14 @@ fi
%ghost %{_sysconfdir}/modprobe.d/kvm.rt.tuned.conf
%{_prefix}/lib/tuned/realtime-virtual-guest
%{_prefix}/lib/tuned/realtime-virtual-host
%{_libexecdir}/tuned/defirqaffinity*
%{_mandir}/man7/tuned-profiles-nfv.7*
%files profiles-cpu-partitioning
%defattr(-,root,root,-)
%config(noreplace) %{_sysconfdir}/tuned/cpu-partitioning-variables.conf
%{_prefix}/lib/tuned/cpu-partitioning
%{_mandir}/man7/tuned-profiles-cpu-partitioning.7*
%files profiles-compat
%defattr(-,root,root,-)
%{_prefix}/lib/tuned/default
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment