Precompiling regular expressions for runtime tuning and do not
log errors like process doesn't exist in runtime tuning.
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
It can now tune newly created processes. This functionality
is by default on and can be disabled in tuned profile by setting:
[scheduler]
runtime = 0
This is temporaly workaround. In the future this will be handled
by per-plugin dynamic_tuning configuration and not by "runtime"
option.
resolves: rhbz#1148546
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
Most of the functionality don' work in this mode, it just
applies the settings, no rollback possible.
Disable daemon by setting 'daemon = 0' in /etc/tuned/tuned-main.conf
This settings can be overridden if running tuned with '-d' command line
option. In such case daemon mode will be used.
Resolves: rhbz#1068663
Also fixed interpretation of booleans in main config.
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
Profiles shipped in tuned-profiles-nfv subpackage. The content was provided
by Jeremy Eder <jeder@redhat.com> and Clark Williams <williams@redhat.com>.
Resolves: rhbz#1228803
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
The rhbz#1235768 is can't fix, but using:
After=network.target
should fix the ordering of services, so sysctl is no more rewritten by systemd.
Related: rhbz#1189263
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
This target will remove all RPMs older than cca. one week if the total space
occupied by RPMs is larger than 5 MB.
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
Also removed transparent_hugepages from throughput-performance profile.
Added support for 'madvise' setting of transparent_hugepages.
Resolves: rhbz#1189868
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
If there is no hdparm command it now outputs warning to the log, disables
all hdparm related commands and no hdparm execution error is output.
Related: rhbz#1191775
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
This allows runnig helper scripts from the main script by just using
the current directory './' path, e.g. to run helper_script from main script:
./helper_script
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
There is continuous integration Jenkins bind to the scratch builds.
By running scratch build during the nightly build all tests will be
run by Jenkins.
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
Example of recommend.conf content:
[powersave]
/etc/machine.conf=.*laptop.*
This will recommend powersave profile if there is /etc/machine.conf containing
string 'laptop'. The check will not match if the file doesn't exist.
To just check for file existence:
[powersave]
/etc/machine.conf=.*
This will match if there is /etc/machine.conf file.
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
On some platforms the 'recommend' functionality doens't make sense
as there is only one product variant. On such platforms the recommend
functionality can be disabled by adding/changing the following in
the global config (/etc/tuned/tuned-main.conf):
recommend_command = 0
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
If there is no scaling governor/driver, the CPU is silently skipped when setting
governor.
Related: rhbz#1212836
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
It converts CPU list to hexadecimal CPU mask and inverts it.
Example:
[variables]
cpus = ${f:cpulist2hex_invert:1-2}
On machine with four CPUs it returns 00000009.
Related: rhbz#1225135
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
It's possible to combine CPU lists with hexmasks, but hexmask needs to be
prefixed by "0x". Hexmasks can include commas. To separate hexmask from
CPU list use double comma ',,' (there can be whitespaces between commas)
Example:
[variables]
cpus = ${f:cpulist_unpack:1-2,0x8,ffffffff,,37-39}
It's also possible to separate hexmasks and CPU list by specifying
CPU list as another argument, e.g.:
[variables]
cpus = ${f:cpulist_unpack:1-2,0x8,ffffffff:37-39}
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
Now CPUs starting with 0x are taken as hexmask. As cpulist_unpack
is used as preprocessor of CPU list for other built-in functions
this also works with other functions (e.g. cpulist_invert).
Example:
[variables]
cpus = ${f:cpulist_invert:1-2,0x8}
On four CPU machines (CPUs 0-3) it expands to '0'.
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
Inverts list of CPUs (makes its complement). For the complement it
gets number of present CPUs from the /sys/devices/system/cpu/present,
e.g. system with 4 CPUs (0-3), the inversion of list "0,2,3" will be "1".
Related: rhbz#1225135
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
Now it operates over CPU sets parsed from /sys/devices/system/cpu/online
and it no more checks each CPU from the list individually for its online
status.
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
Usage:
[variables]
cpus = ${f:cpulist_unpack:1,2,3-5}
The 'cpus' will be set to '1,2,3,4,5'. Also the built-in function can take
arbitrary number of arguments which will be concatenated, e.g.:
[variables]
cpus = ${f:cpulist_unpack:1-3,5:6-7,9}
This means two arguments to 'cpulist_unpack' function. The first argument:
'1-3,5' and the second '6-7,9'. The result: '1,2,3,5,6,7,9'.
Also renamed internal function 'unpack_cpulist' to 'cpulist_unpack' to be
more consistent.
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
Added following functions:
cpulist2hex - converts CPU list to hexadecimal mask, takes arbitrary number of
arguments, each argument can also contain "compact values",
e.g.: "${f:cpulist2hex:0-3,4:5-6}".
hex2cpulist - converts hexadecimal mask to CPU list, takes one argument,
the hexadecimal mask.
cpus_online - checks whether CPUs from the list (which is formatted the same
way as with cpulist2hex) are online, returns only those which
are online.
Example:
[variables]
cpus = ${f:hex2cpulist:0x0000001f}
online = ${f:cpus_online:${cpus}}
Related: rhbz#1225135
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
Built-in functions are defined as plugins in tuned/profiles/functions.
Each function (plugin) is python code named function_NAME.py, where
NAME is the name of the built-in function defined. For example
how to implement own function see provided functions.
Functions are expanded in tuned profile configuration file during profile
load. Functions are expanded after variables. The syntax for function call is
${f:NAME:ARG1:ARG2...}. The function NAME will be called and it's result
substituted. It is possible to escape $ by \$ and : by \:. Functions are
loaded and executed on demand. Function which is once loaded during profile
application is not reloaded on multiple executions. Variables
in profile arguments are supported, but function calls aren't.
The following functions have been implemented so far:
exec:ARG1:...:ARGN - execute external command with arguments and subtitute
its output.
kb2s:ARG - converts kbytes specified as ARG to sectors.
s2kb:ARG - converts sectors specified as ARG to kbytes.
Example:
[variables]
cmd = date
curr_date = ${f:exec:${cmd}}
This commit also changed escaping of variables to be consistent with
functions. They can be now escaped by \, i.e. \${VAR} will not be expanded.
Escaping by double '$' is no more supported.
This commit also removes handler for all exceptions during profile loading.
This is not to mask real errors and ease development.
Resolves: rhbz#1225135
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
This is for simple synchronization. When the message is logged it is
guranteed that everything was applied and is set in place.
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
$${VAR} will be rewritten as ${VAR} and not expanded.
Only alphanumeric characters and underscores (those with matches regular
expression \w+$) are allowed in variable name.
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>