Plugin_net instances can now be given a new 'ring' option with
the following values (see ethtool(8) for their meaning):
rx N
rx-mini N
rx-jumbo N
tx N
The syntax is the same as the syntax for 'coalesce' and 'features'
parameters introduced in commit bc5d7acca8.
Example:
[net]
ring=rx 1024 tx 512
Resolves: https://github.com/redhat-performance/tuned/issues/2
Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
Plugin_net instances can now be given a new 'pause' option with
the following values (see ethtool(8) for their meaning):
autoneg on|off
rx on|off
tx on|off
The syntax is the same as the syntax for 'coalesce' and 'features'
parameters introduced in commit bc5d7acca8.
Example:
[net]
pause=autoneg off rx off
Resolves: https://github.com/redhat-performance/tuned/issues/2
Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
This will add tuned_initrd to newly installed kernels upon Tuned
restart. It's workaround for rhbz#1442117.
Resolves: rhbz#1441797
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
The strip functions makes string from all arguments and
expands to its stripped version.
Also used in the cpu-partitioning profile to strip output
of the 'mktemp -d' command.
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
Users can switch to Tuned if they need process blacklisting
(i.e. marking of processes which are allowed to run on
isolated cores). This will be very probably made the default
in next Tuned release.
Related: rhbz#1403309
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
Fix an invocation of execute() after its API changed.
Reproducer:
Run tuned with the following profile, and you'll see error messages
'tuned.utils.commands: Executing ethtool error: ethtool: bad command line argument(s)'
in the log. Replace 'enp0s25' with your ethernet interface:
[net]
devices=enp0s25
coalesce=rx-usecs 4
Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
Older systemd (systemd-219 tested) doesn't support commas as delimiters.
It also doesn't support ranges (e.g. 2-5). So always write unpacked
CPU list and use spaces as delimiters. Also fixed possible traceback
in case /etc/systemd/system.conf is empty (it's unlikely to happen).
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
Fixes the following:
[variables]
v=${f:f1:}
if 'f1' expands to empty string it doesn't traceback now.
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
Plugin scheduler now can do cores isolation on its own, Tuna is
not needed for it, e.g.:
[scheduler]
isolated_cores=2-4
ps_blacklist=.*pmd.*;.*PMD.*;^DPDK;.*qemu-kvm.*
It will isolate cores 2-4, it will ignore processes which matched
ps_blacklist regexes. Multiple regexes can be separated by ';'.
Quoted semicolon, i.e. '\;' is taken literally.
It also supports 'ps_whitelist' which is by default set to '.*'.
It takes all processes which matches ps_whitelist than it removes
those which matches ps_blacklist and move them out of the
isolated_cores. When the profile is unloaded it allows all matching
processes to run on all cores.
It changes processes affinities, threads affinities, IRQs affinities
and it sets default_smp_affinity for IRQs.
Also cpu-partitioning profile has been switched from Tuna to this
mechanism.
Resolves: rhbz#1403309
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
Now all units (e.g. [variables]) preserve order of options, e.g.
[variables]
c=1
b=${c}
a=${b}
The ${a} now correctly expands to '1' and not to '${b}'.
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
Now it skips:
\${VAR}
\${f:FUNC}
Instead of:
\${f:FUNC\}
This second form is now not supported.
Also simplified the parser.
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
The virt_check builtin function expands to the first argument if
running inside virtual machine, otherwise it expands to the second
argument (when on bare metal or in case of error). It uses virt-what
as a backend.
So now the following can be used to lower fragmentation of Tuned profiles:
[main]
include=virtual-${f:virt_check:guest:host}
So it will include virtual-guest if running inside virtual machine,
otherwise it includes virtual-host.
Resolves: rhbz#1426654
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
Parser rewritten to use pushdown automaton, now it can correctly parse
e.g. the following:
[variables]
cores1=2-5
isolated_cores=${f:cpulist_pack:${f:cpulist_unpack:${cores1}}},${f:cpulist_unpack:6-8}
I.e. nested functions are no problem now, multiple functions on the same
level also works and it correctly skips unexpanded variables. It's also
possible to prevent function expansion by escaping:
v=\${f:f1\}
Variables expansion could be now probably also moved to this automaton and
all could be expanded in one step, but for now keeping it as is (i.e. two
steps expansion).
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
With systemd full rollback is done if Tuned is terminated by user or profile
is changed. It is not done if Tuned is terminated due to system
shutdown / reboot. Without systemd full rollback is done only if profile
is changed.
Renamed profile_switch parameter to full_rollback where appropriate.
Also fixed various checks for command not found.
Resolves: rhbz#1421286
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
There is no need for profiles to requires exact NVR of the engine,
or other profiles, relaxed it to NV (i.e. only name, version requirement,
but no release requirement).
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
This function takes three arguments:
etxt - the text to be logged if the assertion fails
var1 - first variable to compare
var2 - seconf variable to compare
The function compares 'var1' and' var2'. If they match it logs 'etxt' and
raises exception which will abort profile loading.
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
Fixed parsing of e.g.:
${f🅰️${var1}:${var2}}
If var1 wasn't defined it was incorrectly parsed as:
f🅰️${var1
I.e. it resulted in invalid number of parameters error, as the
called function was missing the second parameter.
Now with bot variables undefined it parses as:
f🅰️${var1}:${var2}
I.e. it resulted in correct number of parameters even with
undefined variables.
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
Error message about no isolated cores set wasn't displayed,
because the current plugin_script code only logs messages written
to STDERR.
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
After this change, any delayed changes of spindown are applied
as soon as the drive becomes active.
Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
Don't run 'hdparm -S' with a lower spindown value than previously
applied, if the drive has already spun down. Executing the command
in that case makes the drive spin up with some HDDs.
Resolves https://github.com/redhat-performance/tuned/issues/1
Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
Log errors when applying a profile fails and also log explicitly
when we're trying to load the previously applied profile.
Resolves: rhbz#1434360
Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>