Message ID | 20180226140950.12111-1-aneesh.kumar@linux.vnet.ibm.com (mailing list archive) |
---|---|
State | Changes Requested |
Headers | show |
Series | [V2] powerpc: Don't do runtime futex_cmpxchg test | expand |
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 <div dir="auto"><div><div class="gmail_extra"><div class="gmail_quote">On 27 Feb. 2018 00:34, "Aneesh Kumar K.V" <<a href="mailto:aneesh.kumar@linux.vnet.ibm.com">aneesh.kumar@linux.vnet.ibm.com</a>> wrote:<br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">futex_detect_cmpxchg() does a cmpxchg_futex_value_locked on a NULL user addr to<br> runtime detect whether architecture implements atomic cmpxchg for futex. POWER<br> do implement the feature and hence we can enable the config instead of depending<br> on runtime detection.<br> <br> We could possible enable this on everything. For now limitted to book3s_64<br></blockquote></div></div></div><div dir="auto"><br></div><div dir="auto">I think everything implements it? Might as well do it all at once.</div><div dir="auto"><br></div><div dir="auto">I wouldn't mind putting in an explicit null dereference test if we take this out.</div><div dir="auto"><br></div><div dir="auto">Thanks,</div><div dir="auto">Nick</div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> <br> Signed-off-by: Aneesh Kumar K.V <<a href="mailto:aneesh.kumar@linux.vnet.ibm.com">aneesh.kumar@linux.vnet.ibm.<wbr>com</a>><br> ---<br> arch/powerpc/platforms/<wbr>Kconfig.cputype | 1 +<br> 1 file changed, 1 insertion(+)<br> <br> diff --git a/arch/powerpc/platforms/<wbr>Kconfig.cputype b/arch/powerpc/platforms/<wbr>Kconfig.cputype<br> index a429d859f15d..31bc2bd5dfd1 100644<br> --- a/arch/powerpc/platforms/<wbr>Kconfig.cputype<br> +++ b/arch/powerpc/platforms/<wbr>Kconfig.cputype<br> @@ -75,6 +75,7 @@ config PPC_BOOK3S_64<br> select ARCH_SUPPORTS_NUMA_BALANCING<br> select IRQ_WORK<br> select HAVE_KERNEL_XZ<br> + select HAVE_FUTEX_CMPXCHG if FUTEX<br> <br> config PPC_BOOK3E_64<br> bool "Embedded processors"<br> <font color="#888888">--<br> 2.14.3<br> <br> </font></blockquote></div><br></div></div></div>
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
"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
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"
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(+)