realtime: added conditional support for managed_irq
Also added regex_search_ternary built-in function.
It takes arguments in the following form:
STR1, REGEX, STR2, STR3
If REGEX matches STR1 (re.search is used), STR2 is returned,
if it doesn't match STR3 is returned.
Example:
[variables]
foo=Y
bar=${f:regex_search_ternary:${foo}:\b[y,Y,1,t,T]\b:foo:bar}
It will result in the 'foo' string stored in the '${bar}' variable.
Resolves: rhbz#1797025
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
This commit is contained in:
parent
9bb73e8f40
commit
5ed61ce394
3 changed files with 32 additions and 1 deletions
|
|
@ -2,3 +2,10 @@
|
|||
# isolated_cores=2,4-7
|
||||
# isolated_cores=2-23
|
||||
#
|
||||
#
|
||||
# Uncomment the 'isolate_managed_irq=Y' bellow if you want to move kernel
|
||||
# managed IRQs out of isolated cores. Note that this requires kernel
|
||||
# support. Please only specify this parameter if you are sure that the
|
||||
# kernel supports it.
|
||||
#
|
||||
# isolate_managed_irq=Y
|
||||
|
|
|
|||
|
|
@ -28,6 +28,9 @@ isolated_cores_online_expanded=${f:cpulist_online:${isolated_cores}}
|
|||
# Fail if isolated_cores contains CPUs which are not online
|
||||
assert2=${f:assertion:isolated_cores contains online CPU(s):${isolated_cores_expanded}:${isolated_cores_online_expanded}}
|
||||
|
||||
# Assembly managed_irq
|
||||
managed_irq=${f:regex_search_ternary:${isolate_managed_irq}:\b[y,Y,1,t,T]\b:managed_irq,domain,:}
|
||||
|
||||
[sysctl]
|
||||
kernel.hung_task_timeout_secs = 600
|
||||
kernel.nmi_watchdog = 0
|
||||
|
|
@ -41,7 +44,7 @@ kernel.timer_migration = 0
|
|||
/sys/devices/system/machinecheck/machinecheck*/ignore_ce = 1
|
||||
|
||||
[bootloader]
|
||||
cmdline_realtime=+isolcpus=${isolated_cores} intel_pstate=disable nosoftlockup tsc=nowatchdog
|
||||
cmdline_realtime=+isolcpus=${managed_irq}${isolated_cores} intel_pstate=disable nosoftlockup tsc=nowatchdog
|
||||
|
||||
[script]
|
||||
script = ${i:PROFILE_DIR}/script.sh
|
||||
|
|
|
|||
21
tuned/profiles/functions/function_regex_search_ternary.py
Normal file
21
tuned/profiles/functions/function_regex_search_ternary.py
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
import re
|
||||
from . import base
|
||||
|
||||
class regex_search_ternary(base.Function):
|
||||
"""
|
||||
Ternary regex operator, it takes arguments in the following form
|
||||
STR1, REGEX, STR2, STR3
|
||||
If REGEX matches STR1 (re.search is used), STR2 is returned,
|
||||
otherwise STR3 is returned
|
||||
"""
|
||||
def __init__(self):
|
||||
# 4 arguments
|
||||
super(regex_search_ternary, self).__init__("regex_search_ternary", 4)
|
||||
|
||||
def execute(self, args):
|
||||
if not super(regex_search_ternary, self).execute(args):
|
||||
return None
|
||||
if re.search(args[1], args[0]):
|
||||
return args[2]
|
||||
else:
|
||||
return args[3]
|
||||
Loading…
Reference in a new issue