@@ -2488,6 +2488,11 @@
0: force disabled
1: force enabled
+ ktext= [ARM64] Control kernel text replication on NUMA
+ machines. Default: disabled.
+ 0: disable kernel text replication
+ 1: enable kernel text replication
+
kunit.enable= [KUNIT] Enable executing KUnit tests. Requires
CONFIG_KUNIT to be set to be fully enabled. The
default value can be overridden via
@@ -98,6 +98,21 @@ void ktext_replication_patch_alternative(__le32 *src, int nr_inst)
}
}
+static bool ktext_enabled;
+
+static int __init parse_ktext(char *str)
+{
+ bool enabled;
+ int ret = strtobool(str, &enabled);
+
+ if (ret)
+ return ret;
+
+ ktext_enabled = enabled;
+ return 0;
+}
+early_param("ktext", parse_ktext);
+
/* Allocate page tables and memory for the replicated kernel texts. */
void __init ktext_replication_init(void)
{
@@ -119,6 +134,9 @@ void __init ktext_replication_init(void)
return;
}
+ if (!ktext_enabled)
+ return;
+
for_each_node(nid) {
/* Nothing to do for node 0 */
if (!nid)
Provide an early kernel option "ktext=" which allows the kernel text replication to be enabled. This takes a boolean argument. The way this has been implemented means that we take all the same paths through the kernel at runtime whether kernel text replication has been enabled or not; this allows the performance effects of the code changes to be evaluated separately from the act of running with replicating the kernel text. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> --- .../admin-guide/kernel-parameters.txt | 5 +++++ arch/arm64/mm/ktext.c | 18 ++++++++++++++++++ 2 files changed, 23 insertions(+)