linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V2] powerpc: Don't do runtime futex_cmpxchg test
@ 2018-02-26 14:09 Aneesh Kumar K.V
  2018-02-26 22:16 ` Nicholas Piggin
  2018-02-28 10:44 ` Michael Ellerman
  0 siblings, 2 replies; 4+ messages in thread
From: Aneesh Kumar K.V @ 2018-02-26 14:09 UTC (permalink / raw)
  To: benh, paulus, mpe; +Cc: linuxppc-dev, Aneesh Kumar K.V

futex_detect_cmpxchg() does a cmpxchg_futex_value_locked on a NULL user addr to
runtime detect whether architecture implements atomic cmpxchg for futex. POWER
do implement the feature and hence we can enable the config instead of depending
on runtime detection.

We could possible enable this on everything. For now limitted to book3s_64

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
---
 arch/powerpc/platforms/Kconfig.cputype | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/powerpc/platforms/Kconfig.cputype b/arch/powerpc/platforms/Kconfig.cputype
index a429d859f15d..31bc2bd5dfd1 100644
--- a/arch/powerpc/platforms/Kconfig.cputype
+++ b/arch/powerpc/platforms/Kconfig.cputype
@@ -75,6 +75,7 @@ config PPC_BOOK3S_64
 	select ARCH_SUPPORTS_NUMA_BALANCING
 	select IRQ_WORK
 	select HAVE_KERNEL_XZ
+	select HAVE_FUTEX_CMPXCHG if FUTEX
 
 config PPC_BOOK3E_64
 	bool "Embedded processors"
-- 
2.14.3

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

* Re: [PATCH V2] powerpc: Don't do runtime futex_cmpxchg test
  2018-02-26 14:09 [PATCH V2] powerpc: Don't do runtime futex_cmpxchg test Aneesh Kumar K.V
@ 2018-02-26 22:16 ` Nicholas Piggin
  2018-02-27  4:00   ` Aneesh Kumar K.V
  2018-02-28 10:44 ` Michael Ellerman
  1 sibling, 1 reply; 4+ messages in thread
From: Nicholas Piggin @ 2018-02-26 22:16 UTC (permalink / raw)
  To: Aneesh Kumar K.V; +Cc: Benjamin Herrenschmidt, paulus, mpe, linuxppc-dev

[-- Attachment #1: Type: text/plain, Size: 1211 bytes --]

On 27 Feb. 2018 00:34, "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
wrote:

futex_detect_cmpxchg() does a cmpxchg_futex_value_locked on a NULL user
addr to
runtime detect whether architecture implements atomic cmpxchg for futex.
POWER
do implement the feature and hence we can enable the config instead of
depending
on runtime detection.

We could possible enable this on everything. For now limitted to book3s_64


I think everything implements it? Might as well do it all at once.

I wouldn't mind putting in an explicit null dereference test if we take
this out.

Thanks,
Nick



Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
---
 arch/powerpc/platforms/Kconfig.cputype | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/powerpc/platforms/Kconfig.cputype
b/arch/powerpc/platforms/Kconfig.cputype
index a429d859f15d..31bc2bd5dfd1 100644
--- a/arch/powerpc/platforms/Kconfig.cputype
+++ b/arch/powerpc/platforms/Kconfig.cputype
@@ -75,6 +75,7 @@ config PPC_BOOK3S_64
        select ARCH_SUPPORTS_NUMA_BALANCING
        select IRQ_WORK
        select HAVE_KERNEL_XZ
+       select HAVE_FUTEX_CMPXCHG if FUTEX

 config PPC_BOOK3E_64
        bool "Embedded processors"
--
2.14.3

[-- Attachment #2: Type: text/html, Size: 2203 bytes --]

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

* Re: [PATCH V2] powerpc: Don't do runtime futex_cmpxchg test
  2018-02-26 22:16 ` Nicholas Piggin
@ 2018-02-27  4:00   ` Aneesh Kumar K.V
  0 siblings, 0 replies; 4+ messages in thread
From: Aneesh Kumar K.V @ 2018-02-27  4:00 UTC (permalink / raw)
  To: Nicholas Piggin; +Cc: Benjamin Herrenschmidt, paulus, mpe, linuxppc-dev

Nicholas Piggin <nicholas.piggin@gmail.com> writes:

> On 27 Feb. 2018 00:34, "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
> wrote:
>
> futex_detect_cmpxchg() does a cmpxchg_futex_value_locked on a NULL user
> addr to
> runtime detect whether architecture implements atomic cmpxchg for futex.
> POWER
> do implement the feature and hence we can enable the config instead of
> depending
> on runtime detection.
>
> We could possible enable this on everything. For now limitted to book3s_64
>
>
> I think everything implements it? Might as well do it all at once.
>
> I wouldn't mind putting in an explicit null dereference test if we take
> this out.

If the config is not selected we do that with futex_detect_cmpxchg()
right? Or are you suggesting something else?

>
> Thanks,
> Nick
>
>
>
> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
> ---
>  arch/powerpc/platforms/Kconfig.cputype | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/arch/powerpc/platforms/Kconfig.cputype
> b/arch/powerpc/platforms/Kconfig.cputype
> index a429d859f15d..31bc2bd5dfd1 100644
> --- a/arch/powerpc/platforms/Kconfig.cputype
> +++ b/arch/powerpc/platforms/Kconfig.cputype
> @@ -75,6 +75,7 @@ config PPC_BOOK3S_64
>         select ARCH_SUPPORTS_NUMA_BALANCING
>         select IRQ_WORK
>         select HAVE_KERNEL_XZ
> +       select HAVE_FUTEX_CMPXCHG if FUTEX
>
>  config PPC_BOOK3E_64
>         bool "Embedded processors"
> --
> 2.14.3

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

* Re: [PATCH V2] powerpc: Don't do runtime futex_cmpxchg test
  2018-02-26 14:09 [PATCH V2] powerpc: Don't do runtime futex_cmpxchg test Aneesh Kumar K.V
  2018-02-26 22:16 ` Nicholas Piggin
@ 2018-02-28 10:44 ` Michael Ellerman
  1 sibling, 0 replies; 4+ messages in thread
From: Michael Ellerman @ 2018-02-28 10:44 UTC (permalink / raw)
  To: Aneesh Kumar K.V, benh, paulus; +Cc: linuxppc-dev, Aneesh Kumar K.V

"Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com> writes:

> futex_detect_cmpxchg() does a cmpxchg_futex_value_locked on a NULL user addr to
> runtime detect whether architecture implements atomic cmpxchg for futex. POWER
> do implement the feature and hence we can enable the config instead of depending
> on runtime detection.
>
> We could possible enable this on everything. For now limitted to book3s_64
>
> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
> ---
>  arch/powerpc/platforms/Kconfig.cputype | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/arch/powerpc/platforms/Kconfig.cputype b/arch/powerpc/platforms/Kconfig.cputype
> index a429d859f15d..31bc2bd5dfd1 100644
> --- a/arch/powerpc/platforms/Kconfig.cputype
> +++ b/arch/powerpc/platforms/Kconfig.cputype
> @@ -75,6 +75,7 @@ config PPC_BOOK3S_64
>  	select ARCH_SUPPORTS_NUMA_BALANCING
>  	select IRQ_WORK
>  	select HAVE_KERNEL_XZ
> +	select HAVE_FUTEX_CMPXCHG if FUTEX
  
I'd rather it was under config PPC with an if BOOK3S_64 check. Just so
that all those top-level style configs are in once place.

eg.

config PPC
	...
	select HAVE_FUTEX_CMPXCHG if FUTEX && PPC_BOOK3S_64

cheers

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

end of thread, other threads:[~2018-02-28 10:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-26 14:09 [PATCH V2] powerpc: Don't do runtime futex_cmpxchg test Aneesh Kumar K.V
2018-02-26 22:16 ` Nicholas Piggin
2018-02-27  4:00   ` Aneesh Kumar K.V
2018-02-28 10:44 ` 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).