All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Revert "powerpc/powernv/idle: Replace CPU feature check with PVR check"
@ 2020-08-26  8:29 Pratik Rajesh Sampat
  2020-08-26  8:37 ` Christophe Leroy
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Pratik Rajesh Sampat @ 2020-08-26  8:29 UTC (permalink / raw)
  To: linuxppc-dev, mpe, npiggin, mikey, ego, svaidy, linux-kernel,
	pratik.r.sampat, psampat

Cpuidle stop state implementation has minor optimizations for P10
where hardware preserves more SPR registers compared to P9.
The current P9 driver works for P10, although does few extra
save-restores. P9 driver can provide the required power management
features like SMT thread folding and core level power savings
on a P10 platform.

Until the P10 stop driver is available, revert the commit which
allows for only P9 systems to utilize cpuidle and blocks all
idle stop states for P10.
Cpu idle states are enabled and tested on the P10 platform
with this fix.

This reverts commit 8747bf36f312356f8a295a0c39ff092d65ce75ae.

Fixes: 8747bf36f312 ("powerpc/powernv/idle: Replace CPU feature check with PVR check")
Signed-off-by: Pratik Rajesh Sampat <psampat@linux.ibm.com>
---
 @mpe: This revert would resolve a staging issue wherein the P10 stop
 driver is not yet ready while cpuidle stop states need not be blocked
 on 5.9 for Power10 systems which could cause SMT folding related
 performance issues.

 The P10 stop driver is in the works here:
 https://lists.ozlabs.org/pipermail/linuxppc-dev/2020-August/216773.html

 arch/powerpc/platforms/powernv/idle.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/platforms/powernv/idle.c b/arch/powerpc/platforms/powernv/idle.c
index 77513a80cef9..345ab062b21a 100644
--- a/arch/powerpc/platforms/powernv/idle.c
+++ b/arch/powerpc/platforms/powernv/idle.c
@@ -1223,7 +1223,7 @@ static void __init pnv_probe_idle_states(void)
 		return;
 	}
 
-	if (pvr_version_is(PVR_POWER9))
+	if (cpu_has_feature(CPU_FTR_ARCH_300))
 		pnv_power9_idle_init();
 
 	for (i = 0; i < nr_pnv_idle_states; i++)
-- 
2.25.4


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

* Re: [PATCH] Revert "powerpc/powernv/idle: Replace CPU feature check with PVR check"
  2020-08-26  8:29 [PATCH] Revert "powerpc/powernv/idle: Replace CPU feature check with PVR check" Pratik Rajesh Sampat
@ 2020-08-26  8:37 ` Christophe Leroy
  2020-08-26  9:14   ` Pratik Sampat
  2020-08-26  9:40   ` Vaidyanathan Srinivasan
  2020-08-27  7:46 ` Michael Ellerman
  2 siblings, 1 reply; 7+ messages in thread
From: Christophe Leroy @ 2020-08-26  8:37 UTC (permalink / raw)
  To: Pratik Rajesh Sampat, linuxppc-dev, mpe, npiggin, mikey, ego,
	svaidy, linux-kernel, pratik.r.sampat



Le 26/08/2020 à 10:29, Pratik Rajesh Sampat a écrit :
> Cpuidle stop state implementation has minor optimizations for P10
> where hardware preserves more SPR registers compared to P9.
> The current P9 driver works for P10, although does few extra
> save-restores. P9 driver can provide the required power management
> features like SMT thread folding and core level power savings
> on a P10 platform.
> 
> Until the P10 stop driver is available, revert the commit which
> allows for only P9 systems to utilize cpuidle and blocks all
> idle stop states for P10.
> Cpu idle states are enabled and tested on the P10 platform
> with this fix.
> 
> This reverts commit 8747bf36f312356f8a295a0c39ff092d65ce75ae.
> 
> Fixes: 8747bf36f312 ("powerpc/powernv/idle: Replace CPU feature check with PVR check")
> Signed-off-by: Pratik Rajesh Sampat <psampat@linux.ibm.com>
> ---
>   @mpe: This revert would resolve a staging issue wherein the P10 stop
>   driver is not yet ready while cpuidle stop states need not be blocked
>   on 5.9 for Power10 systems which could cause SMT folding related
>   performance issues.
> 
>   The P10 stop driver is in the works here:
>   https://lists.ozlabs.org/pipermail/linuxppc-dev/2020-August/216773.html
> 
>   arch/powerpc/platforms/powernv/idle.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/powerpc/platforms/powernv/idle.c b/arch/powerpc/platforms/powernv/idle.c
> index 77513a80cef9..345ab062b21a 100644
> --- a/arch/powerpc/platforms/powernv/idle.c
> +++ b/arch/powerpc/platforms/powernv/idle.c
> @@ -1223,7 +1223,7 @@ static void __init pnv_probe_idle_states(void)
>   		return;
>   	}
>   
> -	if (pvr_version_is(PVR_POWER9))
> +	if (cpu_has_feature(CPU_FTR_ARCH_300))

Why not something like:

	if (pvr_version_is(PVR_POWER9) || pvr_version_is(PVR_POWER10))
		pnv_power9_idle_init();


>   		pnv_power9_idle_init();
>   
>   	for (i = 0; i < nr_pnv_idle_states; i++)
> 

Christophe

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

* Re: [PATCH] Revert "powerpc/powernv/idle: Replace CPU feature check with PVR check"
  2020-08-26  8:37 ` Christophe Leroy
@ 2020-08-26  9:14   ` Pratik Sampat
  2020-08-27  6:07     ` Michael Ellerman
  0 siblings, 1 reply; 7+ messages in thread
From: Pratik Sampat @ 2020-08-26  9:14 UTC (permalink / raw)
  To: Christophe Leroy, linuxppc-dev, mpe, npiggin, mikey, ego, svaidy,
	linux-kernel, pratik.r.sampat



On 26/08/20 2:07 pm, Christophe Leroy wrote:
>
>
> Le 26/08/2020 à 10:29, Pratik Rajesh Sampat a écrit :
>> Cpuidle stop state implementation has minor optimizations for P10
>> where hardware preserves more SPR registers compared to P9.
>> The current P9 driver works for P10, although does few extra
>> save-restores. P9 driver can provide the required power management
>> features like SMT thread folding and core level power savings
>> on a P10 platform.
>>
>> Until the P10 stop driver is available, revert the commit which
>> allows for only P9 systems to utilize cpuidle and blocks all
>> idle stop states for P10.
>> Cpu idle states are enabled and tested on the P10 platform
>> with this fix.
>>
>> This reverts commit 8747bf36f312356f8a295a0c39ff092d65ce75ae.
>>
>> Fixes: 8747bf36f312 ("powerpc/powernv/idle: Replace CPU feature check 
>> with PVR check")
>> Signed-off-by: Pratik Rajesh Sampat <psampat@linux.ibm.com>
>> ---
>>   @mpe: This revert would resolve a staging issue wherein the P10 stop
>>   driver is not yet ready while cpuidle stop states need not be blocked
>>   on 5.9 for Power10 systems which could cause SMT folding related
>>   performance issues.
>>
>>   The P10 stop driver is in the works here:
>> https://lists.ozlabs.org/pipermail/linuxppc-dev/2020-August/216773.html
>>
>>   arch/powerpc/platforms/powernv/idle.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/arch/powerpc/platforms/powernv/idle.c 
>> b/arch/powerpc/platforms/powernv/idle.c
>> index 77513a80cef9..345ab062b21a 100644
>> --- a/arch/powerpc/platforms/powernv/idle.c
>> +++ b/arch/powerpc/platforms/powernv/idle.c
>> @@ -1223,7 +1223,7 @@ static void __init pnv_probe_idle_states(void)
>>           return;
>>       }
>>   -    if (pvr_version_is(PVR_POWER9))
>> +    if (cpu_has_feature(CPU_FTR_ARCH_300))
>
> Why not something like:
>
>     if (pvr_version_is(PVR_POWER9) || pvr_version_is(PVR_POWER10))
>         pnv_power9_idle_init(); 

In order to use PVR_POWER10 I would need to define it under
arch/powerpc/include/asm/reg.h, which is not present in 5.9 yet.

However, if it okay with @mpe I could split out Nick's P10 stop driver
(https://lists.ozlabs.org/pipermail/linuxppc-dev/2020-August/216773.html)
into two parts:
1. This could include minimal code to introduce the P10 PVR and the
stop wrappers for it. Although this patch internally still calls into
the P9 path. This should gracefully fix the issue.
2. Then later in this patch we could introduce the p10 callback
methods as they are in Nick's series.

---
Thanks
Pratik

>
>>           pnv_power9_idle_init();
>>         for (i = 0; i < nr_pnv_idle_states; i++)
>>
>
> Christophe


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

* Re: [PATCH] Revert "powerpc/powernv/idle: Replace CPU feature check with PVR check"
  2020-08-26  8:29 [PATCH] Revert "powerpc/powernv/idle: Replace CPU feature check with PVR check" Pratik Rajesh Sampat
@ 2020-08-26  9:40   ` Vaidyanathan Srinivasan
  2020-08-26  9:40   ` Vaidyanathan Srinivasan
  2020-08-27  7:46 ` Michael Ellerman
  2 siblings, 0 replies; 7+ messages in thread
From: Vaidyanathan Srinivasan @ 2020-08-26  9:40 UTC (permalink / raw)
  To: Pratik Rajesh Sampat
  Cc: linuxppc-dev, mpe, npiggin, mikey, ego, linux-kernel, pratik.r.sampat

* Pratik Rajesh Sampat <psampat@linux.ibm.com> [2020-08-26 13:59:18]:

> Cpuidle stop state implementation has minor optimizations for P10
> where hardware preserves more SPR registers compared to P9.
> The current P9 driver works for P10, although does few extra
> save-restores. P9 driver can provide the required power management
> features like SMT thread folding and core level power savings
> on a P10 platform.
> 
> Until the P10 stop driver is available, revert the commit which
> allows for only P9 systems to utilize cpuidle and blocks all
> idle stop states for P10.
> Cpu idle states are enabled and tested on the P10 platform
> with this fix.
> 
> This reverts commit 8747bf36f312356f8a295a0c39ff092d65ce75ae.
> 
> Fixes: 8747bf36f312 ("powerpc/powernv/idle: Replace CPU feature check with PVR check")
> Signed-off-by: Pratik Rajesh Sampat <psampat@linux.ibm.com>

Reviewed-by: Vaidyanathan Srinivasan <svaidy@linux.ibm.com>


> ---
>  @mpe: This revert would resolve a staging issue wherein the P10 stop
>  driver is not yet ready while cpuidle stop states need not be blocked
>  on 5.9 for Power10 systems which could cause SMT folding related
>  performance issues.
> 
>  The P10 stop driver is in the works here:
>  https://lists.ozlabs.org/pipermail/linuxppc-dev/2020-August/216773.html
> 
>  arch/powerpc/platforms/powernv/idle.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/powerpc/platforms/powernv/idle.c b/arch/powerpc/platforms/powernv/idle.c
> index 77513a80cef9..345ab062b21a 100644
> --- a/arch/powerpc/platforms/powernv/idle.c
> +++ b/arch/powerpc/platforms/powernv/idle.c
> @@ -1223,7 +1223,7 @@ static void __init pnv_probe_idle_states(void)
>  		return;
>  	}
>  
> -	if (pvr_version_is(PVR_POWER9))
> +	if (cpu_has_feature(CPU_FTR_ARCH_300))
>  		pnv_power9_idle_init();
>  
>  	for (i = 0; i < nr_pnv_idle_states; i++)


This revert solves the stated problem and makes kernel v5.9 work
reasonable well on P10 with stop states which are required for SMT
mode changes.

Complete P10 driver has been in the works and will build on this fix
and complete the required platform support and optimizations.

--Vaidy


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

* Re: [PATCH] Revert "powerpc/powernv/idle: Replace CPU feature check with PVR check"
@ 2020-08-26  9:40   ` Vaidyanathan Srinivasan
  0 siblings, 0 replies; 7+ messages in thread
From: Vaidyanathan Srinivasan @ 2020-08-26  9:40 UTC (permalink / raw)
  To: Pratik Rajesh Sampat
  Cc: ego, mikey, pratik.r.sampat, linux-kernel, npiggin, linuxppc-dev

* Pratik Rajesh Sampat <psampat@linux.ibm.com> [2020-08-26 13:59:18]:

> Cpuidle stop state implementation has minor optimizations for P10
> where hardware preserves more SPR registers compared to P9.
> The current P9 driver works for P10, although does few extra
> save-restores. P9 driver can provide the required power management
> features like SMT thread folding and core level power savings
> on a P10 platform.
> 
> Until the P10 stop driver is available, revert the commit which
> allows for only P9 systems to utilize cpuidle and blocks all
> idle stop states for P10.
> Cpu idle states are enabled and tested on the P10 platform
> with this fix.
> 
> This reverts commit 8747bf36f312356f8a295a0c39ff092d65ce75ae.
> 
> Fixes: 8747bf36f312 ("powerpc/powernv/idle: Replace CPU feature check with PVR check")
> Signed-off-by: Pratik Rajesh Sampat <psampat@linux.ibm.com>

Reviewed-by: Vaidyanathan Srinivasan <svaidy@linux.ibm.com>


> ---
>  @mpe: This revert would resolve a staging issue wherein the P10 stop
>  driver is not yet ready while cpuidle stop states need not be blocked
>  on 5.9 for Power10 systems which could cause SMT folding related
>  performance issues.
> 
>  The P10 stop driver is in the works here:
>  https://lists.ozlabs.org/pipermail/linuxppc-dev/2020-August/216773.html
> 
>  arch/powerpc/platforms/powernv/idle.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/powerpc/platforms/powernv/idle.c b/arch/powerpc/platforms/powernv/idle.c
> index 77513a80cef9..345ab062b21a 100644
> --- a/arch/powerpc/platforms/powernv/idle.c
> +++ b/arch/powerpc/platforms/powernv/idle.c
> @@ -1223,7 +1223,7 @@ static void __init pnv_probe_idle_states(void)
>  		return;
>  	}
>  
> -	if (pvr_version_is(PVR_POWER9))
> +	if (cpu_has_feature(CPU_FTR_ARCH_300))
>  		pnv_power9_idle_init();
>  
>  	for (i = 0; i < nr_pnv_idle_states; i++)


This revert solves the stated problem and makes kernel v5.9 work
reasonable well on P10 with stop states which are required for SMT
mode changes.

Complete P10 driver has been in the works and will build on this fix
and complete the required platform support and optimizations.

--Vaidy


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

* Re: [PATCH] Revert "powerpc/powernv/idle: Replace CPU feature check with PVR check"
  2020-08-26  9:14   ` Pratik Sampat
@ 2020-08-27  6:07     ` Michael Ellerman
  0 siblings, 0 replies; 7+ messages in thread
From: Michael Ellerman @ 2020-08-27  6:07 UTC (permalink / raw)
  To: Pratik Sampat, Christophe Leroy, linuxppc-dev, npiggin, mikey,
	ego, svaidy, linux-kernel, pratik.r.sampat

Pratik Sampat <psampat@linux.ibm.com> writes:
> On 26/08/20 2:07 pm, Christophe Leroy wrote:
>> Le 26/08/2020 à 10:29, Pratik Rajesh Sampat a écrit :
>>> Cpuidle stop state implementation has minor optimizations for P10
>>> where hardware preserves more SPR registers compared to P9.
>>> The current P9 driver works for P10, although does few extra
>>> save-restores. P9 driver can provide the required power management
>>> features like SMT thread folding and core level power savings
>>> on a P10 platform.
>>>
>>> Until the P10 stop driver is available, revert the commit which
>>> allows for only P9 systems to utilize cpuidle and blocks all
>>> idle stop states for P10.
>>> Cpu idle states are enabled and tested on the P10 platform
>>> with this fix.
>>>
>>> This reverts commit 8747bf36f312356f8a295a0c39ff092d65ce75ae.
>>>
>>> Fixes: 8747bf36f312 ("powerpc/powernv/idle: Replace CPU feature check 
>>> with PVR check")
>>> Signed-off-by: Pratik Rajesh Sampat <psampat@linux.ibm.com>
>>> ---
>>>   @mpe: This revert would resolve a staging issue wherein the P10 stop
>>>   driver is not yet ready while cpuidle stop states need not be blocked
>>>   on 5.9 for Power10 systems which could cause SMT folding related
>>>   performance issues.
>>>
>>>   The P10 stop driver is in the works here:
>>> https://lists.ozlabs.org/pipermail/linuxppc-dev/2020-August/216773.html
>>>
>>>   arch/powerpc/platforms/powernv/idle.c | 2 +-
>>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/arch/powerpc/platforms/powernv/idle.c 
>>> b/arch/powerpc/platforms/powernv/idle.c
>>> index 77513a80cef9..345ab062b21a 100644
>>> --- a/arch/powerpc/platforms/powernv/idle.c
>>> +++ b/arch/powerpc/platforms/powernv/idle.c
>>> @@ -1223,7 +1223,7 @@ static void __init pnv_probe_idle_states(void)
>>>           return;
>>>       }
>>>   -    if (pvr_version_is(PVR_POWER9))
>>> +    if (cpu_has_feature(CPU_FTR_ARCH_300))
>>
>> Why not something like:
>>
>>     if (pvr_version_is(PVR_POWER9) || pvr_version_is(PVR_POWER10))
>>         pnv_power9_idle_init(); 
>
> In order to use PVR_POWER10 I would need to define it under
> arch/powerpc/include/asm/reg.h, which is not present in 5.9 yet.
>
> However, if it okay with @mpe I could split out Nick's P10 stop driver
> (https://lists.ozlabs.org/pipermail/linuxppc-dev/2020-August/216773.html)
> into two parts:

I'll just take this for now, it's the simplest option.

cheers

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

* Re: [PATCH] Revert "powerpc/powernv/idle: Replace CPU feature check with PVR check"
  2020-08-26  8:29 [PATCH] Revert "powerpc/powernv/idle: Replace CPU feature check with PVR check" Pratik Rajesh Sampat
  2020-08-26  8:37 ` Christophe Leroy
  2020-08-26  9:40   ` Vaidyanathan Srinivasan
@ 2020-08-27  7:46 ` Michael Ellerman
  2 siblings, 0 replies; 7+ messages in thread
From: Michael Ellerman @ 2020-08-27  7:46 UTC (permalink / raw)
  To: pratik.r.sampat, linux-kernel, mpe, mikey, svaidy, ego, npiggin,
	Pratik Rajesh Sampat, linuxppc-dev

On Wed, 26 Aug 2020 13:59:18 +0530, Pratik Rajesh Sampat wrote:
> Cpuidle stop state implementation has minor optimizations for P10
> where hardware preserves more SPR registers compared to P9.
> The current P9 driver works for P10, although does few extra
> save-restores. P9 driver can provide the required power management
> features like SMT thread folding and core level power savings
> on a P10 platform.
> 
> [...]

Applied to powerpc/fixes.

[1/1] Revert "powerpc/powernv/idle: Replace CPU feature check with PVR check"
      https://git.kernel.org/powerpc/c/16d83a540ca4e7f1ebb2b3756869b77451d31414

cheers

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

end of thread, other threads:[~2020-08-27  7:47 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-26  8:29 [PATCH] Revert "powerpc/powernv/idle: Replace CPU feature check with PVR check" Pratik Rajesh Sampat
2020-08-26  8:37 ` Christophe Leroy
2020-08-26  9:14   ` Pratik Sampat
2020-08-27  6:07     ` Michael Ellerman
2020-08-26  9:40 ` Vaidyanathan Srinivasan
2020-08-26  9:40   ` Vaidyanathan Srinivasan
2020-08-27  7:46 ` Michael Ellerman

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.