From: Patryk Wlazlyn <patryk.wlazlyn@linux.intel.com>
To: "Gautham R. Shenoy" <gautham.shenoy@amd.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 13:09:33 +0100 [thread overview]
Message-ID: <2d541e31-b5e0-41d9-9f08-8b6f0a20d716@linux.intel.com> (raw)
In-Reply-To: <Z0lCtdZKzZQXTWxF@BLRRASHENOY1.amd.com>
>> 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.
Ok. I thought that giving some context on how the change originated might be
useful, but people doesn't seem to like that that much ;]
> "(...) This patch should not have any functional impact."
Yeah, forgot to put that no functional change intended.
>>
>> 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);
That actually is needed.
>>
>> 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);
>> }
>> -
Yeah, missed that one when submitting.
>> #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.
next prev parent reply other threads:[~2024-11-29 12:09 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
2024-11-29 12:09 ` Patryk Wlazlyn [this message]
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=2d541e31-b5e0-41d9-9f08-8b6f0a20d716@linux.intel.com \
--to=patryk.wlazlyn@linux.intel.com \
--cc=artem.bityutskiy@linux.intel.com \
--cc=dave.hansen@linux.intel.com \
--cc=gautham.shenoy@amd.com \
--cc=len.brown@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--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
all inboxes | Powered by JetHome®