linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/3] SRF: Fix offline CPU preventing pc6 entry
@ 2024-11-08 12:29 Patryk Wlazlyn
  2024-11-08 12:29 ` [PATCH v3 1/3] x86/smp: Allow calling mwait_play_dead with arbitrary hint Patryk Wlazlyn
                   ` (4 more replies)
  0 siblings, 5 replies; 51+ messages in thread
From: Patryk Wlazlyn @ 2024-11-08 12:29 UTC (permalink / raw)
  To: x86
  Cc: linux-kernel, linux-pm, rafael.j.wysocki, len.brown,
	artem.bityutskiy, dave.hansen, patryk.wlazlyn

Applied suggestions from Dave and Rafael.

Because we now call a smp function, we have to have ifdefs for
CONFIG_SMP or rely on mwait_play_dead_with_hint to return immediatelly
with an error on non-smp builds. I decided to do the later, but maybe we
should return -ENODEV (or other error constant) instead of 1. I am open
for suggestions.

Removing the existing "kexec hack" by bringing all offlined CPUs back
online before proceeding with the kexec would make it even simpler, but
I am not sure we can do that. It looks kind of obvious to me, but for
some reason the hack exist.

Changes since v2:
  The whole approach changed, but there main things are below.

  * Split mwait_play_dead (old code) into two parts:
    1. Computing mwait hint based on cpuid leaf 0x5
    2. Entering while(1) mwait loop with "kexec hack" handling

  * Prefer cpuidle_play_dead over mwait_play_dead by reordering calls in
    native_play_dead.

  * Add implementation for enter_dead() handler in intel_idle that calls
    executes old mwait_play_dead code, but with the mwait hint from the
    cpuidle state table.


Patryk Wlazlyn (3):
  x86/smp: Allow calling mwait_play_dead with arbitrary hint
  x86/smp native_play_dead: Prefer cpuidle_play_dead() over
    mwait_play_dead()
  intel_idle: Provide enter_dead() handler for SRF

 arch/x86/include/asm/smp.h |  6 ++++++
 arch/x86/kernel/smpboot.c  | 29 ++++++++++++++++++++---------
 drivers/idle/intel_idle.c  | 16 ++++++++++++++++
 3 files changed, 42 insertions(+), 9 deletions(-)

-- 
2.47.0


^ permalink raw reply	[flat|nested] 51+ messages in thread

end of thread, other threads:[~2024-11-25  5:46 UTC | newest]

Thread overview: 51+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-08 12:29 [PATCH v3 0/3] SRF: Fix offline CPU preventing pc6 entry Patryk Wlazlyn
2024-11-08 12:29 ` [PATCH v3 1/3] x86/smp: Allow calling mwait_play_dead with arbitrary hint Patryk Wlazlyn
2024-11-08 16:03   ` Dave Hansen
2024-11-12 10:54     ` Patryk Wlazlyn
2024-11-08 12:29 ` [PATCH v3 2/3] x86/smp native_play_dead: Prefer cpuidle_play_dead() over mwait_play_dead() Patryk Wlazlyn
2024-11-08 16:14   ` Dave Hansen
2024-11-12 10:55     ` Patryk Wlazlyn
2024-11-12 11:47   ` Peter Zijlstra
2024-11-12 12:03     ` Rafael J. Wysocki
2024-11-12 12:18       ` Peter Zijlstra
2024-11-12 12:30         ` Rafael J. Wysocki
2024-11-12 12:38           ` Rafael J. Wysocki
2024-11-12 13:49           ` Peter Zijlstra
2024-11-12 14:56             ` Rafael J. Wysocki
2024-11-12 15:08               ` Peter Zijlstra
2024-11-12 16:24                 ` Rafael J. Wysocki
2024-11-12 12:44         ` Artem Bityutskiy
2024-11-12 14:01           ` Peter Zijlstra
2024-11-14 12:03             ` Peter Zijlstra
2024-11-15  1:21               ` Thomas Gleixner
2024-11-15 10:07                 ` Peter Zijlstra
2024-11-15 15:37                   ` Thomas Gleixner
2024-11-12 13:23     ` Rafael J. Wysocki
2024-11-12 14:56       ` Peter Zijlstra
2024-11-12 15:00         ` Rafael J. Wysocki
2024-11-13 11:41         ` Gautham R. Shenoy
2024-11-13 16:14           ` Dave Hansen
2024-11-14  5:06             ` Gautham R. Shenoy
2024-11-13 16:22           ` Peter Zijlstra
2024-11-13 16:27             ` Wysocki, Rafael J
2024-11-14 11:58               ` Rafael J. Wysocki
2024-11-14 12:17                 ` Peter Zijlstra
2024-11-14 17:36             ` Gautham R. Shenoy
2024-11-14 17:58               ` Rafael J. Wysocki
2024-11-14 11:58           ` Peter Zijlstra
2024-11-14 17:24             ` Gautham R. Shenoy
2024-11-15 10:11               ` Peter Zijlstra
2024-11-25  5:45                 ` Gautham R. Shenoy
2024-11-08 12:29 ` [PATCH v3 3/3] intel_idle: Provide enter_dead() handler for SRF Patryk Wlazlyn
2024-11-08 16:21   ` Dave Hansen
2024-11-12 10:57     ` Patryk Wlazlyn
2024-11-12 11:28       ` Rafael J. Wysocki
2024-11-12 16:07         ` Dave Hansen
2024-11-12 19:17         ` Thomas Gleixner
2024-11-12 19:43           ` Rafael J. Wysocki
2024-11-08 22:12   ` kernel test robot
2024-11-08 16:22 ` [PATCH v3 0/3] SRF: Fix offline CPU preventing pc6 entry Dave Hansen
2024-11-12 11:45 ` Peter Zijlstra
2024-11-12 15:43   ` Patryk Wlazlyn
2024-11-13  1:19     ` Thomas Gleixner
2024-11-14 17:13       ` Patryk Wlazlyn

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).