From cf8f326c44ac2693531de5c9dba146a783a29943 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaroslav=20=C5=A0karvada?= Date: Mon, 18 Jul 2016 16:23:21 +0200 Subject: [PATCH] plugin_vm: introduced transparent_hugepage alias to transparent_hugepages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Kernel uses 'transparent_hugepage', but Tuned has been so far using 'transparent_hugepages', which was confusing. The new Tuned alias is meant to improve the situation, so Tuned users can now use both variants. It's possible that Tuned will drop 'transparent_hugepages' sometimes in the future. Resolves: rhbz#1249610 Signed-off-by: Jaroslav Škarvada --- tuned/plugins/plugin_vm.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tuned/plugins/plugin_vm.py b/tuned/plugins/plugin_vm.py index 110a24d..bc08adf 100644 --- a/tuned/plugins/plugin_vm.py +++ b/tuned/plugins/plugin_vm.py @@ -19,6 +19,7 @@ class VMPlugin(base.Plugin): def _get_config_options(self): return { "transparent_hugepages" : None, + "transparent_hugepage" : None, } def _instance_init(self, instance): @@ -58,6 +59,11 @@ class VMPlugin(base.Plugin): log.warn("Option 'transparent_hugepages' is not supported on current hardware.") return None + # just an alias to transparent_hugepages + @command_set("transparent_hugepage") + def _set_transparent_hugepage(self, value, sim): + self._set_transparent_hugepages(value, sim) + @command_get("transparent_hugepages") def _get_transparent_hugepages(self): sys_file = self._thp_file() @@ -65,3 +71,8 @@ class VMPlugin(base.Plugin): return cmd.get_active_option(cmd.read_file(sys_file)) else: return None + + # just an alias to transparent_hugepages + @command_get("transparent_hugepage") + def _get_transparent_hugepage(self): + return self._get_transparent_hugepages()