All of lore.kernel.org
 help / color / mirror / Atom feed
From: Frederic Weisbecker <frederic@kernel.org>
To: Sehee Jeong <sehee1.jeong@samsung.com>
Cc: anna-maria@linutronix.de, tglx@linutronix.de, corbet@lwn.net,
	linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org
Subject: Re: timers/migration: add 'notmigr' kernel parameter to disable timer migration
Date: Tue, 2 Sep 2025 16:29:28 +0200	[thread overview]
Message-ID: <aLb_SJ2MYefD4JuN@localhost.localdomain> (raw)
In-Reply-To: <20250807064849.3988-1-sehee1.jeong@samsung.com>

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

  reply	other threads:[~2025-09-02 14:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [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 [this message]
2025-09-03 15:37   ` Thomas Gleixner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aLb_SJ2MYefD4JuN@localhost.localdomain \
    --to=frederic@kernel.org \
    --cc=anna-maria@linutronix.de \
    --cc=corbet@lwn.net \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sehee1.jeong@samsung.com \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.