lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20250910074251.8148-2-sehee1.jeong@samsung.com>
Date: Wed, 10 Sep 2025 16:42:51 +0900
From: Sehee Jeong <sehee1.jeong@...sung.com>
To: anna-maria@...utronix.de, frederic@...nel.org, tglx@...utronix.de,
	corbet@....net
Cc: linux-kernel@...r.kernel.org, linux-doc@...r.kernel.org,
	sehee1.jeong@...sung.com
Subject: [PATCH v2 1/1] timers/migration: add 'tmigr' kernel parameter to
 optionally disable timer migration

On heterogeneous systems with big.LITTLE architectures, timer migration
may cause timers from little cores to run on big cores, or vice versa,
because core type differences are not considered in the current timer
migration logic. This can be undesirable in systems that require
strict power management.

For example, if timers are frequently migrated to a big CPU, it must
handle callbacks that could have run on a little CPU. This reduces the
big CPU's idle residency and increases overall energy consumption due to
higher power draw on the big CPU.

To avoid this issue, introduce an early boot parameter to optionally
disable timer migration:

    tmigr=on|off	(default: on)

When set to "off", timer migration initialization is skipped entirely.

Signed-off-by: Sehee Jeong <sehee1.jeong@...sung.com>
---
 .../admin-guide/kernel-parameters.txt         |  4 ++++
 kernel/time/timer_migration.c                 | 19 +++++++++++++++++++
 2 files changed, 23 insertions(+)

diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
index ab4c049faba9..0f5d42c046bb 100644
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -6783,6 +6783,10 @@
 			Force threading of all interrupt handlers except those
 			marked explicitly IRQF_NO_THREAD.
 
+	tmigr		[KNL,EARLY] Enable/disable timer migration
+			Valid parameters: on, off
+			Default: on
+
 	topology=	[S390,EARLY]
 			Format: {off | on}
 			Specify if the kernel should make use of the cpu
diff --git a/kernel/time/timer_migration.c b/kernel/time/timer_migration.c
index 72538baa7a1f..00e3740aec98 100644
--- a/kernel/time/timer_migration.c
+++ b/kernel/time/timer_migration.c
@@ -422,6 +422,8 @@ static unsigned int tmigr_crossnode_level __read_mostly;
 
 static DEFINE_PER_CPU(struct tmigr_cpu, tmigr_cpu);
 
+static bool tmigr_enabled = true;
+
 #define TMIGR_NONE	0xFF
 #define BIT_CNT		8
 
@@ -1790,6 +1792,9 @@ static int __init tmigr_init(void)
 
 	BUILD_BUG_ON_NOT_POWER_OF_2(TMIGR_CHILDREN_PER_GROUP);
 
+	if (!tmigr_enabled)
+		return 0;
+
 	/* Nothing to do if running on UP */
 	if (ncpus == 1)
 		return 0;
@@ -1854,3 +1859,17 @@ static int __init tmigr_init(void)
 	return ret;
 }
 early_initcall(tmigr_init);
+
+static int __init tmigr_setup(char *str)
+{
+	if (!str)
+		return 0;
+
+	if (!strcmp(str, "off"))
+		tmigr_enabled = false;
+	else if (!strcmp(str, "on"))
+		tmigr_enabled = true;
+
+	return 0;
+}
+early_param("tmigr", tmigr_setup);
-- 
2.49.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ