From 7e627f819302b8c22098b0575c35a3349c4e306f Mon Sep 17 00:00:00 2001 From: Tobias Huschle Date: Mon, 12 Aug 2024 13:39:32 +0200 Subject: [PATCH] s390/topology: Add config option to switch to vertical during boot By default, all systems on s390 start in horizontal cpu polarization. Selecting the new config option SCHED_TOPOLOGY_VERTICAL allows to build a kernel that switches to vertical polarization during boot. Acked-by: Heiko Carstens Tested-by: Mete Durlu Signed-off-by: Tobias Huschle Signed-off-by: Vasily Gorbik --- arch/s390/Kconfig | 8 ++++++++ arch/s390/kernel/topology.c | 2 ++ 2 files changed, 10 insertions(+) diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig index abc7e1cc0e7c3..2ee634bab222d 100644 --- a/arch/s390/Kconfig +++ b/arch/s390/Kconfig @@ -513,6 +513,14 @@ config SCHED_TOPOLOGY making when dealing with machines that have multi-threading, multiple cores or multiple books. +config SCHED_TOPOLOGY_VERTICAL + def_bool y + bool "Use vertical CPU polarization by default" + depends on SCHED_TOPOLOGY + help + Use vertical CPU polarization by default if available. + The default CPU polarization is horizontal. + source "kernel/Kconfig.hz" config CERT_STORE diff --git a/arch/s390/kernel/topology.c b/arch/s390/kernel/topology.c index 4bd0ee8eb1ab5..58da6d1bae45b 100644 --- a/arch/s390/kernel/topology.c +++ b/arch/s390/kernel/topology.c @@ -674,6 +674,8 @@ static int __init topology_init(void) set_topology_timer(); else topology_update_polarization_simple(); + if (IS_ENABLED(CONFIG_SCHED_TOPOLOGY_VERTICAL)) + set_polarization(1); register_sysctl("s390", topology_ctl_table); dev_root = bus_get_dev_root(&cpu_subsys); -- 2.47.3