Skip to contentSkip to conversation

powerpc: always enable queued spinlocks for 64s, disable for others

PATCH Superseded Nicholas Piggin 2 participants 3 messages Dec 21, 2020 – Dec 22, 2020 PowerPC

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Nicholas Piggin

author reviewer
#0 lore raw

PATCH 1/1 powerpc: always enable queued spinlocks for 64s, disable for others

Queued spinlocks have shown to have good performance and fairness properties even on smaller (2 socket) POWER systems. This selects them automatically for 64s. For other platforms they are de-selected, the standard spinlock is far simpler and smaller code, and single chips with a handful of cores is unlikely to show any improvement.

CONFIG_EXPERT still allows this to be changed, e.g., to help debug performance or correctness issues.

---
 arch/powerpc/Kconfig | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
arch/powerpc/Kconfig +3 -5
index ae7391627054..1f9f9e64d638 100644
@@ -255,6 +255,7 @@ config PPC
 	select PCI_MSI_ARCH_FALLBACKS		if PCI_MSI
 	select PCI_SYSCALL			if PCI
 	select PPC_DAWR				if PPC64
+	select PPC_QUEUED_SPINLOCKS		if !EXPERT && PPC_BOOK3S_64 && SMP
 	select RTC_LIB
 	select SPARSE_IRQ
 	select SYSCTL_EXCEPTION_TRACE
@@ -506,16 +507,13 @@ config HOTPLUG_CPU
 config PPC_QUEUED_SPINLOCKS
 	bool "Queued spinlocks"
 	depends on SMP
+	depends on EXPERT || PPC_BOOK3S_64
+
 	help
 	  Say Y here to use queued spinlocks which give better scalability and
 	  fairness on large SMP and NUMA systems without harming single threaded
 	  performance.
 
-	  This option is currently experimental, the code is more complex and
-	  less tested so it defaults to "N" for the moment.
-
-	  If unsure, say "N".
-
 config ARCH_CPU_PROBE_RELEASE
 	def_bool y
 	depends on HOTPLUG_CPU
Signature · 1 line
2.23.0
#1 lore raw

Le 21/12/2020 à 04:22, Nicholas Piggin a écrit :

Quoted 19 lines

Queued spinlocks have shown to have good performance and fairness properties even on smaller (2 socket) POWER systems. This selects them automatically for 64s. For other platforms they are de-selected, the standard spinlock is far simpler and smaller code, and single chips with a handful of cores is unlikely to show any improvement.

CONFIG_EXPERT still allows this to be changed, e.g., to help debug performance or correctness issues.

---
  arch/powerpc/Kconfig | 8 +++-----
  1 file changed, 3 insertions(+), 5 deletions(-)
arch/powerpc/Kconfig +0 -0
index ae7391627054..1f9f9e64d638 100644

arch/powerpc/Kconfig config PPC · line 258

Quoted 4 lines
arch/powerpc/Kconfig +1 -0
@@ -255,6 +255,7 @@ config PPC
  	select PCI_MSI_ARCH_FALLBACKS		if PCI_MSI
  	select PCI_SYSCALL			if PCI
  	select PPC_DAWR				if PPC64
+	select PPC_QUEUED_SPINLOCKS		if !EXPERT && PPC_BOOK3S_64 && SMP

The condition is a bit complicated, and it doesn't set it to Y by default when EXPERT is selected.

arch/powerpc/Kconfig config HOTPLUG_CPU · line 511

Quoted 9 lines
arch/powerpc/Kconfig +2 -0
  	select RTC_LIB
  	select SPARSE_IRQ
  	select SYSCTL_EXCEPTION_TRACE
@@ -506,16 +507,13 @@ config HOTPLUG_CPU
  config PPC_QUEUED_SPINLOCKS
  	bool "Queued spinlocks"
  	depends on SMP
+	depends on EXPERT || PPC_BOOK3S_64
+

I would do:

config PPC_QUEUED_SPINLOCKS
bool "Queued spinlocks" if EXPERT
depends on SMP
default PPC_BOOK3S_64

Quoted 4 lines
arch/powerpc/Kconfig +0 -0
  	help
  	  Say Y here to use queued spinlocks which give better scalability and
  	  fairness on large SMP and NUMA systems without harming single threaded

arch/powerpc/Kconfig config HOTPLUG_CPU · line 519

Quoted 10 lines
arch/powerpc/Kconfig +0 -5
  	  performance.
 
-	  This option is currently experimental, the code is more complex and
-	  less tested so it defaults to "N" for the moment.
-
-	  If unsure, say "N".
-
  config ARCH_CPU_PROBE_RELEASE
  	def_bool y
  	depends on HOTPLUG_CPU

Christophe

author reviewer
#2 lore raw

Excerpts from Christophe Leroy's message of December 21, 2020 4:04 pm:

Quoted 17 lines

Le 21/12/2020 à 04:22, Nicholas Piggin a écrit :

Quoted 14 lines

Queued spinlocks have shown to have good performance and fairness properties even on smaller (2 socket) POWER systems. This selects them automatically for 64s. For other platforms they are de-selected, the standard spinlock is far simpler and smaller code, and single chips with a handful of cores is unlikely to show any improvement.

CONFIG_EXPERT still allows this to be changed, e.g., to help debug performance or correctness issues.

---
  arch/powerpc/Kconfig | 8 +++-----
  1 file changed, 3 insertions(+), 5 deletions(-)
Quoted 11 lines

arch/powerpc/Kconfig config PPC · line 258

Quoted 9 lines
arch/powerpc/Kconfig +1 -0
index ae7391627054..1f9f9e64d638 100644
@@ -255,6 +255,7 @@ config PPC
  	select PCI_MSI_ARCH_FALLBACKS		if PCI_MSI
  	select PCI_SYSCALL			if PCI
  	select PPC_DAWR				if PPC64
+	select PPC_QUEUED_SPINLOCKS		if !EXPERT && PPC_BOOK3S_64 && SMP

The condition is a bit complicated, and it doesn't set it to Y by default when EXPERT is selected.

Yeah, I don't know how to do that (switch people's oldconfig from =N to =Y) otherwise (without renaming the option). I think it's enough though, experts should have said yes already :)

Quoted 13 lines

arch/powerpc/Kconfig config HOTPLUG_CPU · line 511

Quoted 10 lines
arch/powerpc/Kconfig +2 -0
  	select RTC_LIB
  	select SPARSE_IRQ
  	select SYSCTL_EXCEPTION_TRACE
@@ -506,16 +507,13 @@ config HOTPLUG_CPU
  config PPC_QUEUED_SPINLOCKS
  	bool "Queued spinlocks"
  	depends on SMP
+	depends on EXPERT || PPC_BOOK3S_64
+

I would do:

Quoted 4 lines

config PPC_QUEUED_SPINLOCKS
bool "Queued spinlocks" if EXPERT
depends on SMP
default PPC_BOOK3S_64

That's nicer.

Thanks,
Nick