Tuning Profile Delivery Mechanism for Linux
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> |
||
|---|---|---|
| .fmf | ||
| contrib | ||
| doc | ||
| experiments | ||
| icons | ||
| libexec | ||
| man | ||
| profiles | ||
| systemtap | ||
| tests | ||
| tuned | ||
| .gitignore | ||
| .packit.yaml | ||
| 00_tuned | ||
| 92-tuned.install | ||
| AUTHORS | ||
| bootcmdline | ||
| ci.fmf | ||
| com.redhat.tuned.policy | ||
| CONTRIBUTING.md | ||
| COPYING | ||
| dbus.conf | ||
| DCO | ||
| INSTALL | ||
| Makefile | ||
| modules.conf | ||
| README | ||
| recommend.conf | ||
| requirements.txt | ||
| TODO | ||
| tuned-adm.bash | ||
| tuned-adm.py | ||
| tuned-gui.desktop | ||
| tuned-gui.glade | ||
| tuned-gui.py | ||
| tuned-main.conf | ||
| tuned.py | ||
| tuned.service | ||
| tuned.spec | ||
| tuned.tmpfiles | ||
Tuned: Daemon for monitoring and adaptive tuning of system devices. (This is tuned 2.0 with a new code base. If you are looking for the older version, please check out branch '1.0' in our Git repository.) How to use it ------------- In Fedora, Red Hat Enterprise Linux, and their derivates install tuned package (optionally tuned-utils, tuned-utils-systemtap, and tuned-profiles-compat): # yum install tuned After the installation, start the tuned service: # systemctl start tuned You might also want to run tuned whenever your machine starts: # systemctl enable tuned If the daemon is running you can easily control it using 'tuned-adm' command line utility. This tool communicates with the daemon over DBus. Any user can list the available profiles and see which one is active. But the profiles can be switched only by root user or by any user with physical console allocated on the machine (X11, physical tty, but no SSH). To see the current active profile, run: $ tuned-adm active To list all available profiles, run: $ tuned-adm list To switch to a different profile, run: # tuned-adm profile <profile-name> Your profile choice is also written into /etc/tuned/active_profile and this choice is used when the daemon is restarted (e.g. with the machine reboot). To disable all tunings, run: # tuned-adm off # tuned-adm recommend Recommend profile suitable for your system. Currently only static detection is implemented - it decides according to data in /etc/system-release-cpe and virt-what output. The rules for autodetection are defined in the file /usr/lib/tuned/recommend.d/50-tuned.conf. They can be overridden by the user by putting a file to /etc/tuned/recommend.d or a file named recommend.conf into /etc/tuned (see tuned-adm(8) for more details). The default rules recommend profiles targeted to the best performance or the balanced profile if unsure. Available tunings ----------------- We are currenlty working on many new tuning features. Some are described in the manual pages, some are yet undocumented. Authors ------- The best way to contact the authors of the project is to use our mailing list: power-management@lists.fedoraproject.org In case you want to contact individual author, you will find the e-mail address in every commit message in our Git repository: https://github.com/redhat-performance/tuned.git You can also join #fedora-power IRC channel on Freenode. Web page: https://tuned-project.org/ Contributing ------------ See the file CONTRIBUTING.md for guidelines for contributing. License ------- Copyright (C) 2008-2019 Red Hat, Inc. 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. Full text of the license is enclosed in COPYING file. The Developer Certificate of Origin, distributed in the file 'DCO' is licensed differently, see the file for the text of the license. The icon: The Tuned icon was created by Mariia Leonova <mleonova@redhat.com> and it is licensed under Creative Commons Attribution-ShareAlike 3.0 license (http://creativecommons.org/licenses/by-sa/3.0/legalcode).