2022-10-19 23:02:05

by Paul E. McKenney

[permalink] [raw]
Subject: [PATCH v3 rcu 08/11] arch/s390: Add ARCH_HAS_NMI_SAFE_THIS_CPU_OPS Kconfig option

The s390 architecture uses either a cmpxchg loop (old systems)
or the laa add-to-memory instruction (new systems) to implement
this_cpu_add(), both of which are NMI safe. This means that the old
and more-efficient srcu_read_lock() may be used in NMI context, without
the need for srcu_read_lock_nmisafe(). Therefore, add the new Kconfig
option ARCH_HAS_NMI_SAFE_THIS_CPU_OPS to arch/arm64/Kconfig, which will
cause NEED_SRCU_NMI_SAFE to be deselected, thus preserving the current
srcu_read_lock() behavior.

Link: https://lore.kernel.org/all/[email protected]/

Suggested-by: Neeraj Upadhyay <[email protected]>
Suggested-by: Frederic Weisbecker <[email protected]>
Suggested-by: Boqun Feng <[email protected]>
Signed-off-by: Paul E. McKenney <[email protected]>
Cc: Heiko Carstens <[email protected]>
Cc: Vasily Gorbik <[email protected]>
Cc: Alexander Gordeev <[email protected]>
Cc: Christian Borntraeger <[email protected]>
Cc: Sven Schnelle <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: John Ogness <[email protected]>
Cc: Petr Mladek <[email protected]>
Cc: <[email protected]>
---
arch/s390/Kconfig | 1 +
1 file changed, 1 insertion(+)

diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig
index 318fce77601d3..0acdfda332908 100644
--- a/arch/s390/Kconfig
+++ b/arch/s390/Kconfig
@@ -73,6 +73,7 @@ config S390
select ARCH_HAS_GIGANTIC_PAGE
select ARCH_HAS_KCOV
select ARCH_HAS_MEM_ENCRYPT
+ select ARCH_HAS_NMI_SAFE_THIS_CPU_OPS
select ARCH_HAS_PTE_SPECIAL
select ARCH_HAS_SCALED_CPUTIME
select ARCH_HAS_SET_MEMORY
--
2.31.1.189.g2e36527f23


2022-10-20 05:53:01

by Christian Borntraeger

[permalink] [raw]
Subject: Re: [PATCH v3 rcu 08/11] arch/s390: Add ARCH_HAS_NMI_SAFE_THIS_CPU_OPS Kconfig option



Am 20.10.22 um 00:58 schrieb Paul E. McKenney:
> The s390 architecture uses either a cmpxchg loop (old systems)
> or the laa add-to-memory instruction (new systems) to implement
> this_cpu_add(), both of which are NMI safe. This means that the old
> and more-efficient srcu_read_lock() may be used in NMI context, without
> the need for srcu_read_lock_nmisafe(). Therefore, add the new Kconfig
> option ARCH_HAS_NMI_SAFE_THIS_CPU_OPS to arch/arm64/Kconfig, which will
s390 ?
> cause NEED_SRCU_NMI_SAFE to be deselected, thus preserving the current
> srcu_read_lock() behavior.
>
> Link: https://lore.kernel.org/all/[email protected]/
>
> Suggested-by: Neeraj Upadhyay <[email protected]>
> Suggested-by: Frederic Weisbecker <[email protected]>
> Suggested-by: Boqun Feng <[email protected]>
> Signed-off-by: Paul E. McKenney <[email protected]>
> Cc: Heiko Carstens <[email protected]>
> Cc: Vasily Gorbik <[email protected]>
> Cc: Alexander Gordeev <[email protected]>
> Cc: Christian Borntraeger <[email protected]>
> Cc: Sven Schnelle <[email protected]>
> Cc: Thomas Gleixner <[email protected]>
> Cc: John Ogness <[email protected]>
> Cc: Petr Mladek <[email protected]>
> Cc: <[email protected]>
> ---
> arch/s390/Kconfig | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig
> index 318fce77601d3..0acdfda332908 100644
> --- a/arch/s390/Kconfig
> +++ b/arch/s390/Kconfig
> @@ -73,6 +73,7 @@ config S390
> select ARCH_HAS_GIGANTIC_PAGE
> select ARCH_HAS_KCOV
> select ARCH_HAS_MEM_ENCRYPT
> + select ARCH_HAS_NMI_SAFE_THIS_CPU_OPS
> select ARCH_HAS_PTE_SPECIAL
> select ARCH_HAS_SCALED_CPUTIME
> select ARCH_HAS_SET_MEMORY

2022-10-20 08:01:34

by Heiko Carstens

[permalink] [raw]
Subject: Re: [PATCH v3 rcu 08/11] arch/s390: Add ARCH_HAS_NMI_SAFE_THIS_CPU_OPS Kconfig option

On Thu, Oct 20, 2022 at 09:23:49AM +0200, Heiko Carstens wrote:
> On Thu, Oct 20, 2022 at 07:16:44AM +0200, Christian Borntraeger wrote:
> > Am 20.10.22 um 00:58 schrieb Paul E. McKenney:
> > > The s390 architecture uses either a cmpxchg loop (old systems)
> > > or the laa add-to-memory instruction (new systems) to implement
> > > this_cpu_add(), both of which are NMI safe. This means that the old
> > > and more-efficient srcu_read_lock() may be used in NMI context, without
> > > the need for srcu_read_lock_nmisafe(). Therefore, add the new Kconfig
> > > option ARCH_HAS_NMI_SAFE_THIS_CPU_OPS to arch/arm64/Kconfig, which will
> > s390 ?

Ah, this typo is what Christian pointed out; missed that.

> > > cause NEED_SRCU_NMI_SAFE to be deselected, thus preserving the current
> > > srcu_read_lock() behavior.
> > >
> > > Link: https://lore.kernel.org/all/[email protected]/
> > >
> > > Suggested-by: Neeraj Upadhyay <[email protected]>
> > > Suggested-by: Frederic Weisbecker <[email protected]>
> > > Suggested-by: Boqun Feng <[email protected]>
> > > Signed-off-by: Paul E. McKenney <[email protected]>
> ...
> > > ---
> > > arch/s390/Kconfig | 1 +
> > > 1 file changed, 1 insertion(+)
>
> Not sure what Christian was trying to say with his empty reply :)
> In any case:
> Acked-by: Heiko Carstens <[email protected]>

2022-10-20 08:09:21

by Heiko Carstens

[permalink] [raw]
Subject: Re: [PATCH v3 rcu 08/11] arch/s390: Add ARCH_HAS_NMI_SAFE_THIS_CPU_OPS Kconfig option

On Thu, Oct 20, 2022 at 07:16:44AM +0200, Christian Borntraeger wrote:
>
>
> Am 20.10.22 um 00:58 schrieb Paul E. McKenney:
> > The s390 architecture uses either a cmpxchg loop (old systems)
> > or the laa add-to-memory instruction (new systems) to implement
> > this_cpu_add(), both of which are NMI safe. This means that the old
> > and more-efficient srcu_read_lock() may be used in NMI context, without
> > the need for srcu_read_lock_nmisafe(). Therefore, add the new Kconfig
> > option ARCH_HAS_NMI_SAFE_THIS_CPU_OPS to arch/arm64/Kconfig, which will
> s390 ?
> > cause NEED_SRCU_NMI_SAFE to be deselected, thus preserving the current
> > srcu_read_lock() behavior.
> >
> > Link: https://lore.kernel.org/all/[email protected]/
> >
> > Suggested-by: Neeraj Upadhyay <[email protected]>
> > Suggested-by: Frederic Weisbecker <[email protected]>
> > Suggested-by: Boqun Feng <[email protected]>
> > Signed-off-by: Paul E. McKenney <[email protected]>
...
> > ---
> > arch/s390/Kconfig | 1 +
> > 1 file changed, 1 insertion(+)

Not sure what Christian was trying to say with his empty reply :)
In any case:
Acked-by: Heiko Carstens <[email protected]>

2022-10-20 16:48:16

by Paul E. McKenney

[permalink] [raw]
Subject: Re: [PATCH v3 rcu 08/11] arch/s390: Add ARCH_HAS_NMI_SAFE_THIS_CPU_OPS Kconfig option

On Thu, Oct 20, 2022 at 09:27:37AM +0200, Heiko Carstens wrote:
> On Thu, Oct 20, 2022 at 09:23:49AM +0200, Heiko Carstens wrote:
> > On Thu, Oct 20, 2022 at 07:16:44AM +0200, Christian Borntraeger wrote:
> > > Am 20.10.22 um 00:58 schrieb Paul E. McKenney:
> > > > The s390 architecture uses either a cmpxchg loop (old systems)
> > > > or the laa add-to-memory instruction (new systems) to implement
> > > > this_cpu_add(), both of which are NMI safe. This means that the old
> > > > and more-efficient srcu_read_lock() may be used in NMI context, without
> > > > the need for srcu_read_lock_nmisafe(). Therefore, add the new Kconfig
> > > > option ARCH_HAS_NMI_SAFE_THIS_CPU_OPS to arch/arm64/Kconfig, which will
> > > s390 ?
>
> Ah, this typo is what Christian pointed out; missed that.
>
> > > > cause NEED_SRCU_NMI_SAFE to be deselected, thus preserving the current
> > > > srcu_read_lock() behavior.
> > > >
> > > > Link: https://lore.kernel.org/all/[email protected]/
> > > >
> > > > Suggested-by: Neeraj Upadhyay <[email protected]>
> > > > Suggested-by: Frederic Weisbecker <[email protected]>
> > > > Suggested-by: Boqun Feng <[email protected]>
> > > > Signed-off-by: Paul E. McKenney <[email protected]>
> > ...
> > > > ---
> > > > arch/s390/Kconfig | 1 +
> > > > 1 file changed, 1 insertion(+)
> >
> > Not sure what Christian was trying to say with his empty reply :)
> > In any case:
> > Acked-by: Heiko Carstens <[email protected]>

I will apply the fix and the ack on my next rebase, thank you both!

Thanx, Paul