public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Gautham R. Shenoy" <gautham.shenoy@amd.com>
To: Patryk Wlazlyn <patryk.wlazlyn@linux.intel.com>
Cc: x86@kernel.org, linux-kernel@vger.kernel.org,
	linux-pm@vger.kernel.org, rafael.j.wysocki@intel.com,
	peterz@infradead.org, dave.hansen@linux.intel.com,
	tglx@linutronix.de, len.brown@intel.com,
	artem.bityutskiy@linux.intel.com
Subject: Re: [PATCH v6 1/4] x86/smp: Allow calling mwait_play_dead with an arbitrary hint
Date: Fri, 29 Nov 2024 09:57:33 +0530	[thread overview]
Message-ID: <Z0lCtdZKzZQXTWxF@BLRRASHENOY1.amd.com> (raw)
In-Reply-To: <20241127161518.432616-2-patryk.wlazlyn@linux.intel.com>

Hello Patryk,

On Wed, Nov 27, 2024 at 05:15:15PM +0100, Patryk Wlazlyn wrote:
> The MWAIT instruction needs different hints on different CPUs to reach
> specific idle states. The current hint calculation in mwait_play_dead()
> code works in practice on current Intel hardware, but is not documented
> and fails on a recent Intel's Sierra Forest and possibly some future
> ones. Those newer CPUs' power efficiency suffers when the CPU is put
> offline.
> 
> Allow cpuidle code to provide mwait_play_dead with a known hint for
> efficient play_dead code.


Just a couple of minor nits:

You could just reword this something along the lines of:

"Introduce a helper function to allow offlined CPUs to enter FFh idle
states with a specific MWAIT hint. The new helper will be used in
subsequent patches by the acpi_idle and intel_idle drivers. This patch
should not have any functional impact."

There is no need to mention MWAIT hint calculation and the Sierra
Forest failure in this patch, as this patch is not doing anything to
fix the issue. Very likely you will be covering that in Patch 4.

> 
> Signed-off-by: Patryk Wlazlyn <patryk.wlazlyn@linux.intel.com>
> ---
>  arch/x86/include/asm/smp.h |  4 +-
>  arch/x86/kernel/smpboot.c  | 86 ++++++++++++++++++++------------------
>  2 files changed, 49 insertions(+), 41 deletions(-)
> 
> diff --git a/arch/x86/include/asm/smp.h b/arch/x86/include/asm/smp.h
> index ca073f40698f..ab90b95037f3 100644
> --- a/arch/x86/include/asm/smp.h
> +++ b/arch/x86/include/asm/smp.h
> @@ -114,6 +114,7 @@ void wbinvd_on_cpu(int cpu);
>  int wbinvd_on_all_cpus(void);
>  
>  void smp_kick_mwait_play_dead(void);
> +void mwait_play_dead_with_hint(unsigned int hint);
>  
>  void native_smp_send_reschedule(int cpu);
>  void native_send_call_func_ipi(const struct cpumask *mask);
> @@ -151,7 +152,6 @@ static inline struct cpumask *cpu_l2c_shared_mask(int cpu)
>  {
>  	return per_cpu(cpu_l2c_shared_map, cpu);
>  }
> -
>  #else /* !CONFIG_SMP */
>  #define wbinvd_on_cpu(cpu)     wbinvd()
>  static inline int wbinvd_on_all_cpus(void)

This hunk is not relevant to this patch.

The rest of the patch looks good to me.
--
Thanks and Regards
gautham.


  reply	other threads:[~2024-11-29  4:27 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-27 16:15 [PATCH v6 0/4] SRF: Fix offline CPU preventing pc6 entry Patryk Wlazlyn
2024-11-27 16:15 ` [PATCH v6 1/4] x86/smp: Allow calling mwait_play_dead with an arbitrary hint Patryk Wlazlyn
2024-11-29  4:27   ` Gautham R. Shenoy [this message]
2024-11-29 12:09     ` Patryk Wlazlyn
2024-11-27 16:15 ` [PATCH v6 2/4] ACPI: processor_idle: Add FFH state handling Patryk Wlazlyn
2024-11-28 13:31   ` kernel test robot
2024-11-28 13:41   ` kernel test robot
2024-11-28 21:17   ` kernel test robot
2024-11-27 16:15 ` [PATCH v6 3/4] intel_idle: Provide the default enter_dead() handler Patryk Wlazlyn
2024-11-27 16:15 ` [PATCH v6 4/4] x86/smp native_play_dead: Prefer cpuidle_play_dead() over mwait_play_dead() Patryk Wlazlyn
2024-12-09 10:16 ` [PATCH v6 0/4] SRF: Fix offline CPU preventing pc6 entry Gautham R. Shenoy
2024-12-09 12:58   ` Patryk Wlazlyn

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=Z0lCtdZKzZQXTWxF@BLRRASHENOY1.amd.com \
    --to=gautham.shenoy@amd.com \
    --cc=artem.bityutskiy@linux.intel.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=len.brown@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=patryk.wlazlyn@linux.intel.com \
    --cc=peterz@infradead.org \
    --cc=rafael.j.wysocki@intel.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox