1
0
Fork 0
Commit graph

1440 commits

Author SHA1 Message Date
Jaroslav Škarvada
8bf0ef493e
scheduler: add support for cgroups
This commit adds cgroup v1 support to the scheduler plugin. It seems that
cgroup v1 is the default on RHEL-8. Systemd uses it there, so we have to
start with the cgroup v1. On Fedora, systemd has been switched to the
cgroup v2 (tested on f31), but it's still possible to intermix there
with the cgroup v1. We can add cgroup v2 support later (the logic of the
extended syntax will not change).

This commit extends the syntax the following way:

[scheduler]
cgroup_mount_point=/sys/fs/cgroup/cpuset
cgroup_mount_point_init=1
cgroup_groups_init=1
cgroup_for_isolated_cores=group
cgroup.group1=2
cgroup.group2=0,2

group.ksoftirqd=0:f:2:cgroup.group1:ksoftirqd.*

ps_blacklist=ksoftirqd.*;rcuc.*;rcub.*;ktimersoftd.*

isolated_cores=1

--
Legend:

'cgroup_mount_point' is where to mount the cgroup FS or where Tuned
expects it to be mounted. If unset '/sys/fs/cgroup/cpuset' is expected.

'cgroup_groups_init' if set to '1' (the default) it means that Tuned
will create (and remove) all cgroups defined with the 'cgroup*' options.
If set to '0' (or similar boolean) the cgroups need to be preset by
some different tool or by hand.

'cgroup_mount_point_init' if set to '1' (or similar boolean) it means that
Tuned will create (and remove) the cgroup mountpoint. It implies
'cgroup_groups_init = 1'. If set to '0' (the default) the cgroups
mount point needs to be preset by some different tool or by hand.

'cgroup_for_isolated_cores' is the cgroup name used for the
'isolated_cores' functionality. For example here if the system has 4 CPUs,
'isolated_cores=1' means that all threads (except of the blacklisted ones
by the 'ps_blacklist' regexes) will be moved to the CPU cores 0,2,3. It will
be done the way that cgroup 'group' will be set to use the affinity 0,2-3
by the 'cpuset.cpus' control file) and all matching threads will be moved
to this cgroup. If 'cgroup_for_isolated_cores' is unset, classic cpuset
affinity will be used to achieve the goal.

'cgroup.CGROUP_NAME' defines affinities for arbitrary cgroups.
Even hierarchic cgroups can be used, but the hieararchy needs to be
specified in the correct order. Also Tuned doesn't do any sanity checks
here (except that it forces the cgroup to be under the mountpoint).
In the example it defines 'group1' with the affinity set to the CPU 2
and 'group2' with the affinity set to CPUs 0, 2.

'group.' its syntax has been extended, so it's now possible to use
e.g. 'cgroup.group1' instead of the hex affinity and the matching
processes will be moved to the 'group1'. It's also possible to use
cgroups which hasn't been defined by the 'cgroup.' option described
above (e.g. cgroups not managed by Tuned).

Before the usage all cgroup names are sanitized by simple algorithm:
all dots '.' are replaced by slashes '/'. It's to prevent the plugin
to write outside the mount point.

Resolves: rhbz#1784648

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2020-06-08 12:51:26 +02:00
Jaroslav Škarvada
d84ac30f9e
Merge pull request #277 from olysonek/cpu-comparison-fix
cpu: Fix string comparisons
2020-06-04 19:32:15 +02:00
Jaroslav Škarvada
9c058502da
Merge pull request #273 from yarda/optimize-serial-console
Added new profile optimize-serial-console
2020-06-04 19:30:56 +02:00
Jaroslav Škarvada
f3d0605b5b
Merge pull request #270 from yarda/arch-preset
Allow override of detected architecture
2020-06-04 19:25:58 +02:00
Jaroslav Škarvada
379fe5e9e5
Merge pull request #269 from yarda/containers-fix
Fixed crash when running inside container
2020-06-04 19:24:36 +02:00
Jaroslav Škarvada
6ab5e5e4ab
Allow override of detected architecture
There should be a way for administrators and testers to force loading of
architecture specific tuning. For example, if there is some specific tuning
for some platforms with specific CPUIDs and the vendor will release new
compatible platform with the new CPUID, there needs to be a way for
administrator to use the tuning on the new platform without waiting for the
Tuned profile update or without the need to customize the profile.

This commit adds two main config options:
uname_string
cpuinfo_string

If unset (commented), which is the default, runtime detection will be used,
i.e. 'uname' will be called and '/proc/cpuinfo' will be read. If set,
content of the variables will be used instead of the runtime detection.

For example by setting:
uname_string = aarch64

It's possible to pretend that Tuned is running on the 64-bit ARM.

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2020-06-04 15:31:41 +02:00
Ondřej Lysoněk
2461cf6568 cpu: Fix string comparisons
The 'is' operator is used to determine object identity. What we want
to do here instead is a value comparison, i.e. the "==" operator.

With the 'is' operator, the conditions would likely never evaluate to
true.

This fixes errors such as these (they seem to get produced during byte
compilation; you can trigger them just by running Tuned).
/root/tuned/tuned/plugins/plugin_cpu.py:76: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if vendor is "GenuineIntel":
/root/tuned/tuned/plugins/plugin_cpu.py:78: SyntaxWarning: "is" with a literal. Did you mean "=="?
  elif vendor is "AuthenticAMD" or vendor is "HygonGenuine":
/root/tuned/tuned/plugins/plugin_cpu.py:78: SyntaxWarning: "is" with a literal. Did you mean "=="?
  elif vendor is "AuthenticAMD" or vendor is "HygonGenuine":

This fixes commit 29022a0edf.

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2020-06-04 14:04:10 +02:00
Jaroslav Škarvada
46207f479b
Fixed crash when running inside container
Fixes #267

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2020-06-04 11:56:21 +02:00
Jaroslav Škarvada
8fd6b5e220
Added new profile optimize-serial-console
Profile which 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 (e.g. throughput-performance profile), example:
 # tuned-adm profile throughput-performance optimize-serial-console

Also minor fixes to the man page quoting.

Resolves: rhbz#1840689

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2020-05-28 15:26:39 +02:00
Jaroslav Škarvada
60a9a9509c
Merge pull request #271 from zdohnal/master
.packit.yaml: Use fedora-all and centos-stream targets
2020-05-28 12:39:31 +02:00
Jaroslav Škarvada
b15bedbac2
Merge pull request #266 from yarda/spectrum-scale-ece
spectrumcale-ece: package the profile to own subpackage
2020-05-27 11:54:01 +02:00
Zdenek Dohnal
2c2315a94b .packit.yaml: Use fedora-all and centos-stream targets 2020-05-27 09:53:46 +02:00
Jaroslav Škarvada
e33d9363d9
spectrumcale-ece: package the profile to own subpackage
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2020-05-19 17:09:19 +02:00
Jaroslav Škarvada
491d133495
Merge pull request #261 from bolinches/master
Spectrum Scale ECE profile
2020-05-11 17:29:39 +02:00
Luis Bolinches
7ce1772a78 Spectrum Scale ECE profile
Signed-off-by: Luis Bolinches <luis.bolinches@fi.ibm.com>
2020-05-11 12:22:39 +03:00
Jaroslav Škarvada
62fb8bbc52
Merge pull request #265 from yarda/network-latency-cmdline-use-unique-suffix
network-latency: used unique cmdline suffix
2020-05-07 18:42:32 +02:00
Jaroslav Škarvada
1be642deac
bootloader: preserved order of cmdline options
I.e. do not explicitly sort cmdline options.

Related: rhbz#1816168

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2020-05-07 14:16:54 +02:00
Jaroslav Škarvada
621464599b
network-latency: used unique cmdline suffix
related: rhbz#1816168

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2020-05-07 14:16:00 +02:00
Jaroslav Škarvada
26d41f44e6
Merge pull request #235 from martinezjavier/skip-s390x
Don't modify the BLS snippets on s390x
2020-04-30 17:21:42 +02:00
Javier Martinez Canillas
33d5386919
Don't modify the BLS snippets on s390x
Currently the 92-tuned.install kernel-install plugin adds the tuned params
to the BLS config files in s390x machines. But the zipl bootloader doesn't
have support for variables, which leads to cmdlines like the following:

root=/dev/mapper/rhel-root crashkernel=auto rd.dasd=0.0.541f rd.dasd=0.0.551f
rd.dasd=0.0.561f rd.dasd=0.0.571f rd.lvm.lv=rhel/root rd.lvm.lv=rhel/swap
cio_ignore=all,!condev rd.znet=qeth,0.0.0600,0.0.0601,0.0.0602,layer2=1,portno=0
$tuned_params BOOT_IMAGE=0

Don't modify the BLS snippet since the zipl bootloader doesn't support the
variables and just make the script to exit if the architecture is s390x.

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
2020-04-29 19:45:06 +02:00
Jaroslav Škarvada
720b93b898
Merge pull request #251 from chuckersjp/master
Adjust FILES section to point to the doc dir  containing the version info
2020-04-29 18:19:40 +02:00
chuckersjp
bc4d788981 Remove line referring to README as the directory may not be standard across releases 2020-04-29 12:04:57 -04:00
Jaroslav Škarvada
0cb964ec26
Merge pull request #260 from jmencak/isolate_managed_irq-inherit
Enable isolate_managed_irq to be defined in child profiles.
2020-04-29 17:29:17 +02:00
Jaroslav Škarvada
398f943f70
Merge pull request #250 from olysonek/disable-timer-migration
cpu-partitioning: Disable kernel.timer_migration
2020-04-29 16:58:00 +02:00
Jaroslav Škarvada
56c294727e
Merge pull request #247 from dlan17/master
drop bashism syntax, make it happy with dash
2020-04-29 16:42:05 +02:00
Jaroslav Škarvada
889743dcd6
Merge pull request #242 from olysonek/man-page-fix
man: Document the possibility to apply more than one profile
2020-04-29 16:36:52 +02:00
Jaroslav Škarvada
0a001186e6
Merge pull request #243 from jmencak/irqbalance-restart
Try-restart irqbalance service upon writing /etc/sysconfig/irqbalance
2020-04-16 15:56:14 +02:00
Jiri Mencak
8d5f5ec4b1 Try-restart irqbalance service upon writing /etc/sysconfig/irqbalance
Relates to: rhbz#1784645

Signed-off-by: Jiri Mencak <jmencak@users.noreply.github.com>
2020-04-16 15:19:49 +02:00
Jaroslav Škarvada
3e2b7069fa
Merge pull request #248 from jmencak/bootcmdline-unapply
Unapply bootcmdline settings even when grub.cfg does not exits.
2020-04-16 15:03:48 +02:00
Jiri Mencak
c930eef0af Enable isolate_managed_irq to be defined in child profiles.
Signed-off-by: Jiri Mencak <jmencak@users.noreply.github.com>
2020-04-16 14:09:55 +02:00
Jaroslav Škarvada
595b8e0996
Merge pull request #249 from hroncok/no-unittest2
Remove usage of unittest2, use unittest from the standard library
2020-03-31 18:38:20 +02:00
Jaroslav Škarvada
15a34ee68d
Merge pull request #256 from yarda/functions-fix-max-args
builtin_functions: fixed check for number of arguments
2020-03-23 19:46:33 +01:00
Jaroslav Škarvada
9ec93ccf59
builtin_functions: fixed check for number of arguments
There can be lower number of arguments than the max limit.
Also fixed definition of functions which wrongly used the API.

I.e. it should work this way:
 # exactly 3 arguments
 __init__("FUNC", 3, 3)

 # max 4 arguments, min 3 arguments (3 - 4 arguments)
 __init__("FUNC", 4, 3)

 # max 3 arguments (0 - 3 arguments)
 __init__("FUNC", 3)

 # min 3 arguments (3 - infinity arguments)
 __init__("FUNC", 0, 3)

 # arbitrary number of arguments (0 - infinity arguments)
 __init__("FUNC", 0)

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2020-03-23 16:35:43 +01:00
Jaroslav Škarvada
751cdb497b
Merge pull request #255 from yarda/rhbz1797025
realtime: added support for managed_irq
2020-03-23 15:35:34 +01:00
Jaroslav Škarvada
5ed61ce394
realtime: added conditional support for managed_irq
Also added regex_search_ternary built-in function.

It takes arguments in the following form:
  STR1, REGEX, STR2, STR3

If REGEX matches STR1 (re.search is used), STR2 is returned,
if it doesn't match STR3 is returned.

Example:
[variables]
foo=Y
bar=${f:regex_search_ternary:${foo}:\b[y,Y,1,t,T]\b:foo:bar}

It will result in the 'foo' string stored in the '${bar}' variable.

Resolves: rhbz#1797025

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2020-03-23 14:43:47 +01:00
chuckersjp
522252f594 Adjust FILES section to point to the doc dir possibly containing the version info 2020-02-28 10:55:06 -05:00
Ondřej Lysoněk
aa859eecdd cpu-partitioning: Disable kernel.timer_migration
Reportedly, it's no longer needed.

Resolves: rhbz#1797629

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2020-02-26 17:42:12 +01:00
Miro Hrončok
2399aa3b2d Remove usage of unittest2, use unittest from the standard library
Fixes https://github.com/redhat-performance/tuned/issues/241

Fedora is removing the unittest2 package: https://bugzilla.redhat.com/show_bug.cgi?id=1794222

tuned is not targeting Python 2.6: https://github.com/redhat-performance/tuned/issues/241#issuecomment-588320175

One thing not present in Python 2.7 is assertItemsEqual() -- renamed to assertCountEqual().

Related, mock was also listed as a requirement in the spec file,
but all the imports are from unittest.mock, hence removed.
2020-02-25 20:04:51 +01:00
Jiri Mencak
8dbb93499b Unapply bootcmdline settings even when grub.cfg does not exits.
Currently when grub.cfg file is not found, the [bootloader] plugin still
modifies /etc/tuned/bootcmdline file.  However, during rollbacks, the settings
applied to that file are not rolled back.  This becomes a problem in
(containerized) environments when grub.cfg file does not exist.  This patch
will make the behaviour more consistent and unapply the settings in
/etc/tuned/bootcmdline even when no grub.cfg is found.

Signed-off-by: Jiri Mencak <jmencak@users.noreply.github.com>
2020-02-25 19:52:01 +01:00
Yixun Lan
8ed2f8fc61 drop bashism syntax, make it happy with dash
see bug report at
https://github.com/redhat-performance/tuned/issues/246
https://bugs.gentoo.org/706164

Signed-off-by: Yixun Lan <dlan@gentoo.org>
2020-02-16 12:27:03 +00:00
Jaroslav Škarvada
9bb73e8f40
Merge pull request #245 from yarda/sst-rename-to-intel-sst
profiles: renamed sst profile to intel-sst
2020-02-12 11:37:19 +01:00
Jaroslav Škarvada
20a71af333
profiles: renamed sst profile to intel-sst
Also updated intel-sst profile manual page describing its usage.

Related: rhbz#1743879

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2020-02-11 17:44:06 +01:00
Ondřej Lysoněk
0bfb310f53 man: Document the possibility to apply more than one profile
'tuned-adm profile' accepts more than one profile. Document it in the
man page.

Resolves: rhbz#1794337

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2020-02-10 18:17:23 +01:00
Jaroslav Škarvada
bfe0eb9194
Merge pull request #244 from olysonek/new-accelerator-performance-profile
Add accelerator-performance profile
2020-02-06 17:59:02 +01:00
Ondřej Lysoněk
9535680992 Add accelerator-performance profile
Resolves: rhbz#1795604

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2020-02-06 17:55:21 +01:00
Jaroslav Škarvada
041333f9c5
Merge pull request #240 from yarda/rhbz1779117
realtime-virtual-host: added ncat requirement
2020-01-14 11:27:27 +01:00
Jaroslav Škarvada
cc11660689
realtime-virtual-host: added ncat requirement
resolves: rhbz#1779117

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2020-01-13 21:29:00 +01:00
Jaroslav Škarvada
d5dce53187
Merge pull request #239 from olysonek/define-empty-isolated-cores
profiles: Make sure variables are defined before use
2020-01-07 22:30:14 +01:00
Ondřej Lysoněk
0eb0c6bc7f profiles: Make sure variables are defined before use
Make sure the isolated_cores and no_balance_cores variables are
defined before any of the variables that use them are defined. This
enforces a certain ordering of variable expansions so that child
profiles can set the variables directly in the profile (tuned.conf),
e.g.:

[main]
include=cpu-partitioning

[variables]
isolated_cores=3

Resolves: rhbz#1781664

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2020-01-06 15:50:06 +01:00
Jaroslav Škarvada
f753351bff
Merge pull request #196 from TomasKorbar/circleci
Start using CircleCi
2019-12-12 17:49:58 +01:00