1
0
Fork 0
Commit graph

1454 commits

Author SHA1 Message Date
Jaroslav Škarvada
c87df6f5cb
Merge pull request #275 from yarda/cgroups
scheduler: add support for cgroups
2020-06-08 20:26:29 +02:00
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
4eebe5f295
Merge pull request #278 from yarda/recommend-fix-indent
recommend: fixed indentation
2020-06-05 23:32:23 +02:00
Jaroslav Škarvada
3e859bd192
recommend: fixed indentation
Related: #259

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2020-06-05 23:28:55 +02:00
Jaroslav Škarvada
9bca523f43
Merge pull request #259 from openSUSE/no_system_cpe_file_error
Avoid error when reading file '/etc/system-release-cpe' on first run
2020-06-05 23:16:58 +02:00
Jaroslav Škarvada
af9e64a213
Merge pull request #276 from yarda/marvell-amd
Arch specific tuning for Marvell ThunderX and AMD
2020-06-05 18:29:56 +02:00
Jaroslav Škarvada
0bdf0a2227
Merge pull request #274 from olysonek/irqbalance-plugin
Add irqbalance plugin
2020-06-05 18:29:07 +02:00
Jaroslav Škarvada
33cca3fe09
Merge pull request #272 from olysonek/post-loaded-profile
Add support for a post-loaded profile
2020-06-05 12:42:13 +02:00
Ondřej Lysoněk
0509247f8b realtime: Use the irqbalance plugin
Use the new irqbalance plugin instead of a script to set up
irqbalance.

I'm placing the 'irqbalance' instance before the 'script' instance so
that it's executed at the same time as the script, however I don't
think the 'irqbalance' instance needs to be ordered in any specific
way and could be placed almost anywhere.

Resolves: rhbz#1784645

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2020-06-05 10:23:42 +02:00
Ondřej Lysoněk
462df2610c cpu-partitioning: Use the irqbalance plugin
Use the new irqbalance plugin instead of a script to set up
irqbalance.

Note that I'm not setting priority for the 'irqbalance' instance,
whereas the 'script' instance has a priority of 5. However, this was
added just for initrd image generation in commit 843dc8cf5f
and I don't think the irqbalance instance needs to be ordered in any
specific way.

Resolves: rhbz#1784645

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2020-06-05 10:23:42 +02:00
Ondřej Lysoněk
3c7b4195e3 Add irqbalance plugin
The irqbalance plugin is a replacement for the bash functions
irqbalance_banned_cpus_setup and irqbalance_banned_cpus_clear. It
configures the banned CPUs in /etc/sysconfig/irqbalance. Then it
restarts irqbalance (if and only if it was previously running).

The banned CPUs can be specified as a CPU list. For example:

[irqbalance]
banned_cpus=2,4,9-13

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>

Resolves: rhbz#1784645
2020-06-05 10:23:24 +02:00
Thomas Renninger
daa01693be Avoid error when reading file '/etc/system-release-cpe' on first run
Not all distros do have /etc/system-release-cpe
2020-06-04 21:45:29 +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
f87263ae20
throughput-performance: added arch specific tuning for AMD
Resolves: rhbz#1746957

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2020-06-04 17:17:30 +02:00
Jaroslav Škarvada
5041abf70a throughput-performance: added arch specific tuning for Marvell ThunderX
Resolves: rhbz#1746961

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2020-06-04 17:15:56 +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
Ondřej Lysoněk
4f5f35830a Add support for a post-loaded profile
This is a minimal viable implementation of a post-loaded profile
feature. It was implemented to satisfy the needs of the
kernel_settings Ansible role.
https://github.com/linux-system-roles/kernel_settings

This feature allows us to apply a profile in a way that is
somewhat separate from the way profiles from the active_profile file
are applied. Namely, the post-loaded profile is always applied after
all the profiles from the active_profile (or more precisely, the
post-loaded profile is always put to the tail of the profile chain
when merging). Also, the post-loaded profile setting is not affected
by running 'tuned-adm profile <some profile>' - the post-loaded
profile remains applied.

The name of the post-loaded profile is stored in
/etc/tuned/post_loaded_profile.

The lack of support for multiple post-loaded profiles was more or less
an arbitrary decision. There are no problems with it, as far as I can
see. However, there is currently no use case for multiple post-loaded
profiles, so I decided to make things easier for our future selves -
it's one less thing to worry about if we need to make changes to the
profile loading logic. We can add support for multiple post-loaded
profiles anytime.

A number of other design decisions went into the
implementation. They are listed here:
https://github.com/redhat-performance/tuned/pull/272

Resolves: rhbz#1798183

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2020-06-01 19:11:29 +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