* timers/migration: add 'notmigr' kernel parameter to disable timer migration
[not found] <CGME20250807064855epcas2p3079c241a4da07d478e713021ca488d13@epcas2p3.samsung.com>
@ 2025-08-07 6:48 ` Sehee Jeong
2025-09-02 14:29 ` Frederic Weisbecker
2025-09-03 15:37 ` Thomas Gleixner
0 siblings, 2 replies; 3+ messages in thread
From: Sehee Jeong @ 2025-08-07 6:48 UTC (permalink / raw)
To: anna-maria, frederic, tglx, corbet; +Cc: linux-kernel, linux-doc, sehee1.jeong
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 taken into account in the current
timer migration logic. This can be undesirable in systems that require
strict power management, predictable latency, or core isolation.
This patch does not attempt to solve the structural limitation,
but provides a workaround by introducing an optional early boot parameter:
notmigr
When specified, timer migration initialization is skipped entirely.
Signed-off-by: Sehee Jeong <sehee1.jeong@samsung.com>
---
Documentation/admin-guide/kernel-parameters.txt | 2 ++
kernel/time/timer_migration.c | 14 ++++++++++++++
2 files changed, 16 insertions(+)
diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
index 85c27c97b826..4bb10ac574e5 100644
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -4132,6 +4132,8 @@
no_timer_check [X86,APIC] Disables the code which tests for
broken timer IRQ sources.
+ notmigr [KNL,EARLY] Disable timer migration.
+
no_uaccess_flush
[PPC,EARLY] Don't flush the L1-D cache after accessing user data.
diff --git a/kernel/time/timer_migration.c b/kernel/time/timer_migration.c
index 72538baa7a1f..7636a1b3ae6b 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,12 @@ static int __init tmigr_init(void)
return ret;
}
early_initcall(tmigr_init);
+
+static int __init notmigr(char *str)
+{
+ tmigr_enabled = false;
+
+ return 0;
+}
+
+early_param("notmigr", notmigr);
--
2.49.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: timers/migration: add 'notmigr' kernel parameter to disable timer migration
2025-08-07 6:48 ` timers/migration: add 'notmigr' kernel parameter to disable timer migration Sehee Jeong
@ 2025-09-02 14:29 ` Frederic Weisbecker
2025-09-03 15:37 ` Thomas Gleixner
1 sibling, 0 replies; 3+ messages in thread
From: Frederic Weisbecker @ 2025-09-02 14:29 UTC (permalink / raw)
To: Sehee Jeong; +Cc: anna-maria, tglx, corbet, linux-kernel, linux-doc
Le Thu, Aug 07, 2025 at 03:48:49PM +0900, Sehee Jeong a écrit :
> 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 taken into account in the current
> timer migration logic. This can be undesirable in systems that require
> strict power management, predictable latency, or core isolation.
>
> This patch does not attempt to solve the structural limitation,
> but provides a workaround by introducing an optional early boot parameter:
>
> notmigr
>
> When specified, timer migration initialization is skipped entirely.
It's a shame we couldn't solve your problem yet but at least such an
option can be nice for general testing beyond big.LITTLE situations.
>
> Signed-off-by: Sehee Jeong <sehee1.jeong@samsung.com>
> ---
> Documentation/admin-guide/kernel-parameters.txt | 2 ++
> kernel/time/timer_migration.c | 14 ++++++++++++++
> 2 files changed, 16 insertions(+)
>
> diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
> index 85c27c97b826..4bb10ac574e5 100644
> --- a/Documentation/admin-guide/kernel-parameters.txt
> +++ b/Documentation/admin-guide/kernel-parameters.txt
> @@ -4132,6 +4132,8 @@
> no_timer_check [X86,APIC] Disables the code which tests for
> broken timer IRQ sources.
>
> + notmigr [KNL,EARLY] Disable timer migration.
> +
> no_uaccess_flush
> [PPC,EARLY] Don't flush the L1-D cache after accessing user data.
>
> diff --git a/kernel/time/timer_migration.c b/kernel/time/timer_migration.c
> index 72538baa7a1f..7636a1b3ae6b 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,12 @@ static int __init tmigr_init(void)
> return ret;
> }
> early_initcall(tmigr_init);
> +
> +static int __init notmigr(char *str)
> +{
> + tmigr_enabled = false;
> +
> + return 0;
> +}
> +
> +early_param("notmigr", notmigr);
This immediately reads like "not migr", which doesn't ring a bell.
no_tmigr would be better. I would even prefer tmigr=off (with default on)
so that the arguments can be further extended in the future if needed.
Thanks
> --
> 2.49.0
>
--
Frederic Weisbecker
SUSE Labs
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: timers/migration: add 'notmigr' kernel parameter to disable timer migration
2025-08-07 6:48 ` timers/migration: add 'notmigr' kernel parameter to disable timer migration Sehee Jeong
2025-09-02 14:29 ` Frederic Weisbecker
@ 2025-09-03 15:37 ` Thomas Gleixner
1 sibling, 0 replies; 3+ messages in thread
From: Thomas Gleixner @ 2025-09-03 15:37 UTC (permalink / raw)
To: Sehee Jeong, anna-maria, frederic, corbet
Cc: linux-kernel, linux-doc, sehee1.jeong
On Thu, Aug 07 2025 at 15:48, Sehee Jeong wrote:
> 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 taken into account in the current
> timer migration logic.
And what's the reason why this should be done?
> This can be undesirable in systems that require strict power
> management, predictable latency, or core isolation.
Undesirable is not really a technical argument. Can you please describe
the actual problems instead of handwaving?
> This patch does not attempt to solve the structural limitation,
# git grep "This patch" Documentation/process/
> but provides a workaround by introducing an optional early boot parameter:
>
> notmigr
>
> When specified, timer migration initialization is skipped entirely.
I agree with Frederic that this naming is suboptimal and should be
tmigr=[on/off].
But aside of that, disabling timer migration causes other power related
issues as it keeps timers always CPU local and therefore fails to let
idle CPUs stay truly idle.
So instead of just having a lazy work around and disabling everything,
this should really be addressed properly. Though without a proper
technical problem description, that's pretty much impossible.
Thanks,
tglx
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-09-03 15:37 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <CGME20250807064855epcas2p3079c241a4da07d478e713021ca488d13@epcas2p3.samsung.com>
2025-08-07 6:48 ` timers/migration: add 'notmigr' kernel parameter to disable timer migration Sehee Jeong
2025-09-02 14:29 ` Frederic Weisbecker
2025-09-03 15:37 ` Thomas Gleixner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).