linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc: Enable generic cpu idle-loop
@ 2023-08-18  5:07 Vaibhav Jain
  2023-08-18 11:18 ` Michael Ellerman
  2023-08-23 11:55 ` Michael Ellerman
  0 siblings, 2 replies; 4+ messages in thread
From: Vaibhav Jain @ 2023-08-18  5:07 UTC (permalink / raw)
  To: linux-doc, linux-kernel, linuxppc-dev
  Cc: Paul E. McKenney, Jonathan Corbet, Peter Zijlstra, Randy Dunlap,
	Steven Rostedt (Google), Nicholas Piggin, Catalin Marinas,
	Vaibhav Jain, Vaidyanathan Srinivasan, Daniel Sneddon

This minor patch enables config option GENERIC_IDLE_POLL_SETUP for arch
powerpc. This should add support for kernel param 'nohlt'.

Powerpc kernel also supports another kernel boot-time param called
'powersave' which can also be used to disable all cpu idle-states and
forces CPU to an idle-loop similar to what cpu_idle_poll() does. This
patch however makes powerpc kernel-parameters better aligned to the
generic boot-time parameters.

Signed-off-by: Vaibhav Jain<vaibhav@linux.ibm.com>
---
 Documentation/admin-guide/kernel-parameters.txt | 2 +-
 arch/powerpc/Kconfig                            | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
index 722b6eca2e93..6b657ebafcfb 100644
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -3738,7 +3738,7 @@
 
 	nohibernate	[HIBERNATION] Disable hibernation and resume.
 
-	nohlt		[ARM,ARM64,MICROBLAZE,MIPS,SH] Forces the kernel to
+	nohlt		[ARM,ARM64,MICROBLAZE,MIPS,PPC,SH] Forces the kernel to
 			busy wait in do_idle() and not use the arch_cpu_idle()
 			implementation; requires CONFIG_GENERIC_IDLE_POLL_SETUP
 			to be effective. This is useful on platforms where the
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 0b1172cbeccb..574661403800 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -193,6 +193,7 @@ config PPC
 	select GENERIC_CPU_VULNERABILITIES	if PPC_BARRIER_NOSPEC
 	select GENERIC_EARLY_IOREMAP
 	select GENERIC_GETTIMEOFDAY
+	select GENERIC_IDLE_POLL_SETUP
 	select GENERIC_IRQ_SHOW
 	select GENERIC_IRQ_SHOW_LEVEL
 	select GENERIC_PCI_IOMAP		if PCI
-- 
2.41.0


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

* Re: [PATCH] powerpc: Enable generic cpu idle-loop
  2023-08-18  5:07 [PATCH] powerpc: Enable generic cpu idle-loop Vaibhav Jain
@ 2023-08-18 11:18 ` Michael Ellerman
  2023-08-21  5:09   ` Vaibhav Jain
  2023-08-23 11:55 ` Michael Ellerman
  1 sibling, 1 reply; 4+ messages in thread
From: Michael Ellerman @ 2023-08-18 11:18 UTC (permalink / raw)
  To: Vaibhav Jain, linux-doc, linux-kernel, linuxppc-dev
  Cc: Paul E. McKenney, Jonathan Corbet, Peter Zijlstra,
	Catalin Marinas, Randy Dunlap, Steven Rostedt (Google),
	Nicholas Piggin, Vaibhav Jain, Vaidyanathan Srinivasan,
	Daniel Sneddon

Vaibhav Jain <vaibhav@linux.ibm.com> writes:
> This minor patch enables config option GENERIC_IDLE_POLL_SETUP for arch
> powerpc. This should add support for kernel param 'nohlt'.

Which is named after an 8086 instruction :), but oh well.

> Powerpc kernel also supports another kernel boot-time param called
> 'powersave' which can also be used to disable all cpu idle-states and
> forces CPU to an idle-loop similar to what cpu_idle_poll() does. This
> patch however makes powerpc kernel-parameters better aligned to the
> generic boot-time parameters.

It would be nice if we could make our powersave=off parameter just
enable this generic logic.

Have you looked at if that's possible? At a glance it looks like it
should be, when cpu_idle_force_poll is true do_idle() never calls
cpuidle_idle_call(), so the cpuidle drivers are never invoked.

cheers

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

* Re: [PATCH] powerpc: Enable generic cpu idle-loop
  2023-08-18 11:18 ` Michael Ellerman
@ 2023-08-21  5:09   ` Vaibhav Jain
  0 siblings, 0 replies; 4+ messages in thread
From: Vaibhav Jain @ 2023-08-21  5:09 UTC (permalink / raw)
  To: Michael Ellerman, linux-doc, linux-kernel, linuxppc-dev
  Cc: Paul E. McKenney, Jonathan Corbet, Peter Zijlstra,
	Catalin Marinas, Randy Dunlap, Steven Rostedt (Google),
	Nicholas Piggin, Vaidyanathan Srinivasan, Daniel Sneddon

Thanks for looking at this patch Mpe.

Michael Ellerman <mpe@ellerman.id.au> writes:

> Vaibhav Jain <vaibhav@linux.ibm.com> writes:
>> This minor patch enables config option GENERIC_IDLE_POLL_SETUP for arch
>> powerpc. This should add support for kernel param 'nohlt'.
>
> Which is named after an 8086 instruction :), but oh well.
>
Thanks. This is an interesting trivia :)

>> Powerpc kernel also supports another kernel boot-time param called
>> 'powersave' which can also be used to disable all cpu idle-states and
>> forces CPU to an idle-loop similar to what cpu_idle_poll() does. This
>> patch however makes powerpc kernel-parameters better aligned to the
>> generic boot-time parameters.
>
> It would be nice if we could make our powersave=off parameter just
> enable this generic logic.
>
> Have you looked at if that's possible? At a glance it looks like it
> should be, when cpu_idle_force_poll is true do_idle() never calls
> cpuidle_idle_call(), so the cpuidle drivers are never invoked.

Thanks for suggesting this and it looks like a simple fix to arch/idle.c
code. I have posted a v2 with the needed change on the mailing list at
https://lore.kernel.org/all/20230821045928.1350893-1-vaibhav@linux.ibm.com

-- 
Cheers
~ Vaibhav

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

* Re: [PATCH] powerpc: Enable generic cpu idle-loop
  2023-08-18  5:07 [PATCH] powerpc: Enable generic cpu idle-loop Vaibhav Jain
  2023-08-18 11:18 ` Michael Ellerman
@ 2023-08-23 11:55 ` Michael Ellerman
  1 sibling, 0 replies; 4+ messages in thread
From: Michael Ellerman @ 2023-08-23 11:55 UTC (permalink / raw)
  To: linux-doc, linux-kernel, linuxppc-dev, Vaibhav Jain
  Cc: Paul E. McKenney, Jonathan Corbet, Peter Zijlstra,
	Catalin Marinas, Randy Dunlap, Steven Rostedt (Google),
	Nicholas Piggin, Vaidyanathan Srinivasan, Daniel Sneddon

On Fri, 18 Aug 2023 10:37:37 +0530, Vaibhav Jain wrote:
> This minor patch enables config option GENERIC_IDLE_POLL_SETUP for arch
> powerpc. This should add support for kernel param 'nohlt'.
> 
> Powerpc kernel also supports another kernel boot-time param called
> 'powersave' which can also be used to disable all cpu idle-states and
> forces CPU to an idle-loop similar to what cpu_idle_poll() does. This
> patch however makes powerpc kernel-parameters better aligned to the
> generic boot-time parameters.
> 
> [...]

Applied to powerpc/next.

[1/1] powerpc: Enable generic cpu idle-loop
      https://git.kernel.org/powerpc/c/0ceef6e99cc3a57f33b84dafc6df5dfb3b28278d

cheers

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

end of thread, other threads:[~2023-08-23 12:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-18  5:07 [PATCH] powerpc: Enable generic cpu idle-loop Vaibhav Jain
2023-08-18 11:18 ` Michael Ellerman
2023-08-21  5:09   ` Vaibhav Jain
2023-08-23 11:55 ` Michael Ellerman

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