Bug 1748965
Summary: | RFE: specific tuning according to /proc/cpuinfo | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 8 | Reporter: | Jaroslav Škarvada <jskarvad> |
Component: | tuned | Assignee: | Jaroslav Škarvada <jskarvad> |
Status: | CLOSED ERRATA | QA Contact: | Robin Hack <rhack> |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 8.2 | CC: | bfinger, jeder, jmario, jskarvad, olysonek, psklenar, rhack, thozza |
Target Milestone: | rc | Keywords: | FutureFeature, Patch, Upstream |
Target Release: | 8.0 | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | tuned-2.13.0-0.1.rc1.el8 | Doc Type: | No Doc Update |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2020-04-28 16:59:29 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: | |||
Bug Depends On: | |||
Bug Blocks: | 1743192, 1755139 |
Description
Jaroslav Škarvada
2019-09-04 14:54:41 UTC
This could be handled more generic way to allow future extensions - e.g. to support matching similar what the 'recommend.conf' allows. Current proposal is to extend plugin instances matching of uname_regex and cpuinfo_regex, e.g.: [variables] cannonalake_cpuinfo=.*\bREGEX1\b.* cannonlake_uname=REGEX2 [cpu_cannonlake] type=cpu cpuinfo_regex=${cannonlake_cpuinfo} uname_regex=${cannonlake_uname} force_latency=C1 [diks_cannonlake] type=disk cpuinfo_regex=${cannonlake_cpuinfo} uname_regex=${cannonlake_uname} readahead=4092 ... And also addition of operator for conditional includes of subprofiles for specific HW, e.g.: [main] include=${cpu:${cannonlake_cpuinfo}:file_cannonlake.conf:other.conf} [variables] cannonalake_cpuinfo=.*\bREGEX1\b.* (In reply to Jaroslav Škarvada from comment #5) > And also addition of operator for conditional includes of subprofiles for > specific HW, e.g.: > > [main] > include=${cpu:${cannonlake_cpuinfo}:file_cannonlake.conf:other.conf} > > [variables] > cannonalake_cpuinfo=.*\bREGEX1\b.* Current proposal for the second feature (fallback_profile will be used when nothing matches, it's optional): [main] include=${cpuinfo:${cannonlake_cpuinfo_regex}:cannonlake_tuned_profile:$(cascadelake_cpuinfo_regex}:cascadelake_tuned_profile:...:fallback_profile} [variables] cannonalake_cpuinfo_regex=.*\bREGEX_CANNONLAKE\b.* cascadelake_cpuinfo_regex=.*\bREGEX_CASCADELAKE\b.* ... It's also possible to combine it with the base profile, the following loads base_tuned_profile and adds specific CPU profile on top of it: [main] include=base_tuned_profile,${cpuinfo:${cannonlake_cpuinfo_regex}:cannonlake_tuned_profile:$(cascadelake_cpuinfo_regex}:cascadelake_tuned_profile} Upstream PR: https://github.com/redhat-performance/tuned/pull/218 It's possible to write now: [variables] cannonalake_cpuinfo=.\bGenuineIntel\b. cannonlake_uname=x86_64 [cpu_cannonlake] type=cpu cpuinfo_regex=${cannonlake_cpuinfo} uname_regex=${cannonlake_uname} force_latency=C1 [disk_cannonlake] type=disk cpuinfo_regex=${cannonlake_cpuinfo} uname_regex=${cannonlake_uname} readahead=4092 ... And the tuning will be applied only on machines which have 'GenuineIntel' string in the /proc/cpuinfo and x86_64 architecture (from uname). Both 'cpuinfo_regex' and 'uname_regex' are optional - if not used it has the same effect as if matching regex is used. This example used variables but it also works without it. Also cpuinfo_check builtin function was added, so it's possible to write the following now: [main] include=${f:cpuinfo_check:\bGenuineIntel\b:intel_profile:other_profile} It tries to match the regex '\bGenuineIntel\b' in the /proc/cpuinfo and if it matches it includes 'intel_profile', if not it includes 'other_profile'. If colon ':' needs to be used in the regex, it needs to be escaped, i.e.: ':' It's even possible to combine it with the generic profiles, e.g.: [main] include=base_profile${f:cpuinfo_check:\bGenuineIntel\b:,intel_profile} It will always include 'base_profile' and if the cpuinfo matches GenuineIntel it also adds the intel_profile. More variants are possible, the generic syntax is: ${f:cpuinfo_check:REGEX1:STR1:REGEX2:STR2,...[,FALLBACK_STR]} It returns STR1 if REGEX1 matches, STR2 if REGEX2 matches, and FALLBACK_STR if nothing matches. If there is no FALLBACK_STR it returns empty string on no match. It exits on the first match found and no more regexes are processed in such case TODO: Current limitation: Variables are not expanded in the include, so it's not possible to write: [main] include=${f:cpuinfo_check:${regex}:test} [variables] regex=TEST (In reply to Jaroslav Škarvada from comment #7) > It will always include 'base_profile' and if the cpuinfo matches > GenuineIntel it also adds the intel_profile. More variants are possible, > the generic syntax is: > > ${f:cpuinfo_check:REGEX1:STR1:REGEX2:STR2,...[,FALLBACK_STR]} > Typo, it should be: ${f:cpuinfo_check:REGEX1:STR1:REGEX2:STR2:...[:FALLBACK_STR]} Just to be clear the example in comment 7 is just synthetic to demonstrate the feature and it will not match Cannonlake CPUs. It matches any x86_64 Intel CPU. For Cannonlake matching correct CPU/model regexes needs to be supplied instead of the generic regex used. Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2020:1883 |