1
0
Fork 0

Merge branch 'redhat-performance:master' into master

This commit is contained in:
uniontech-lilinjie 2022-06-01 02:22:18 +00:00 committed by GitHub
commit 0cb6edfba5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 59 additions and 8 deletions

View file

@ -24,7 +24,7 @@
tuned\-adm - command line tool for switching between different tuning profiles
.SH SYNOPSIS
.B tuned\-adm
.RB [ list " | " active " | " "profile \fI[profile]\fP..." " | " off " | " verify " | " recommend ]
.RB [ list " | " active " | " "profile \fI[profile]\fP..." " | " "profile_info \fI[profile]\fP..." " | " off " | " verify " | " recommend ]
.SH DESCRIPTION
This command line utility allows you to switch between user definable tuning
@ -71,6 +71,10 @@ profile is given, then all available profiles are listed. If the
profile given is not valid, the command gracefully exits without
performing any operation.
.TP
.BI "profile_info " [PROFILE_NAME] ...
Show information/description of given profile or current profile if no profile is specified.
.TP
.B verify
Verifies current profile against system settings. Outputs information whether
@ -96,6 +100,14 @@ name in both directories, the one from \fI/etc/tuned/recommend.d\fP is used)
and the files are evaluated in alphabetical order. The first matching
entry is used.
.TP
.B auto_profile
Enable automatic profile selection mode, switch to the recommended profile.
.TP
.B profile_mode
Show current profile selection mode.
.TP
.B off
Unload tunings.

View file

@ -25,6 +25,10 @@ net.ipv6.neigh.default.gc_thresh2=32768
net.ipv6.neigh.default.gc_thresh3=65536
vm.max_map_count=262144
[sysfs]
/sys/module/nvme_core/parameters/io_timeout=4294967295
/sys/module/nvme_core/parameters/max_retries=10
[scheduler]
# see rhbz#1979352; exclude containers from aligning to house keeping CPUs
cgroup_ps_blacklist=/kubepods\.slice/

View file

@ -52,7 +52,7 @@ kernel.timer_migration = 0
/sys/devices/system/machinecheck/machinecheck*/ignore_ce = 1
[bootloader]
cmdline_realtime=+isolcpus=${managed_irq}${isolated_cores} intel_pstate=disable nosoftlockup tsc=nowatchdog
cmdline_realtime=+isolcpus=${managed_irq}${isolated_cores} intel_pstate=disable nosoftlockup tsc=reliable
[irqbalance]
banned_cpus=${isolated_cores}

View file

@ -21,7 +21,7 @@ class NetTuningPlugin(base.Plugin):
self._load_smallest = 0.05
self._level_steps = 6
self._cmd = commands()
self._re_ip_link_show_qlen = None
self._re_ip_link_show = {}
self._use_ip = True
def _init_devices(self):
@ -144,6 +144,7 @@ class NetTuningPlugin(base.Plugin):
"ring": None,
"channels": None,
"txqueuelen": None,
"mtu": None,
}
def _init_stats_and_idle(self, instance, device):
@ -325,10 +326,13 @@ class NetTuningPlugin(base.Plugin):
return None
return value
def _get_re_ip_link_show_qlen(self):
if self._re_ip_link_show_qlen is None:
self._re_ip_link_show_qlen = re.compile(r".*\s+qlen\s+(\d+)")
return self._re_ip_link_show_qlen
def _get_re_ip_link_show(self, arg):
"""
Return regex for int arg value from "ip link show" command
"""
if arg not in self._re_ip_link_show:
self._re_ip_link_show[arg] = re.compile(r".*\s+%s\s+(\d+)" % arg)
return self._re_ip_link_show[arg]
@command_get("txqueuelen")
def _get_txqueuelen(self, device, ignore_missing=False):
@ -337,7 +341,7 @@ class NetTuningPlugin(base.Plugin):
if not ignore_missing:
log.info("Cannot get 'ip link show' result for txqueuelen value for device '%s'" % device)
return None
res = self._get_re_ip_link_show_qlen().search(out)
res = self._get_re_ip_link_show("qlen").search(out)
if res is None:
# We can theoretically get device without qlen (http://linux-ip.net/gl/ip-cref/ip-cref-node17.html)
if not ignore_missing:
@ -345,6 +349,37 @@ class NetTuningPlugin(base.Plugin):
return None
return res.group(1)
@command_set("mtu", per_device=True)
def _set_mtu(self, value, device, sim):
if value is None:
return None
try:
int(value)
except ValueError:
log.warn("mtu value '%s' is not integer" % value)
return None
if not sim:
res = self._call_ip_link(["set", "dev", device, "mtu", value])
if res is None:
log.warn("Cannot set mtu for device '%s'" % device)
return None
return value
@command_get("mtu")
def _get_mtu(self, device, ignore_missing=False):
out = self._ip_link_show(device)
if out is None:
if not ignore_missing:
log.info("Cannot get 'ip link show' result for mtu value for device '%s'" % device)
return None
res = self._get_re_ip_link_show("mtu").search(out)
if res is None:
# mtu value should be always present, but it's better to have a test
if not ignore_missing:
log.info("Cannot get mtu value from 'ip link show' result for device '%s'" % device)
return None
return res.group(1)
# d is dict: {parameter: value}
def _check_parameters(self, context, d):
if context == "features":