[PATCH V2] powerpc: Don't do runtime futex_cmpxchg test

Subsystems: linux for powerpc (32-bit and 64-bit), the rest

STALE3095d

4 messages, 3 authors, 2018-02-28 · open the first message on its own page

[PATCH V2] powerpc: Don't do runtime futex_cmpxchg test

From: Aneesh Kumar K.V <hidden>
Date: 2018-02-26 14:10:06

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 <redacted>
---
 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

Re: [PATCH V2] powerpc: Don't do runtime futex_cmpxchg test

From: Nicholas Piggin <hidden>
Date: 2018-02-26 22:16:26

On 27 Feb. 2018 00:34, "Aneesh Kumar K.V" [off-list ref]
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 <redacted>
---
 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

Re: [PATCH V2] powerpc: Don't do runtime futex_cmpxchg test

From: Aneesh Kumar K.V <hidden>
Date: 2018-02-27 04:00:24

Nicholas Piggin [off-list ref] writes:
On 27 Feb. 2018 00:34, "Aneesh Kumar K.V" [off-list ref]
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?
quoted hunk
Thanks,
Nick



Signed-off-by: Aneesh Kumar K.V <redacted>
---
 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

Re: [PATCH V2] powerpc: Don't do runtime futex_cmpxchg test

From: Michael Ellerman <mpe@ellerman.id.au>
Date: 2018-02-28 10:44:48

"Aneesh Kumar K.V" [off-list ref] writes:
quoted hunk
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 <redacted>
---
 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help