Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit aeebc264 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull s390 lockref enablement from Heiko Carstens:
 "Enabling the new lockless lockref variant on s390 would have been
  trivial until Tony Luck added a cpu_relax() call into the
  CMPXCHG_LOOP(), with commit d472d9d9 ("lockref: Relax in cmpxchg
  loop")

  As already mentioned cpu_relax() is very expensive on s390 since it
  yields() the current virtual cpu.  So we are talking of several
  thousand cycles.  Considering this enabling the lockless lockref
  variant would contradict the intention of the new semantics.  And also
  some quick measurements show performance regressions of 50% and more.

  Simply removing the cpu_relax() call again seems also not very
  desireable since Waiman Long reported that for some workloads the call
  improved performance by 5%."

* 'lockref' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
  s390: enable ARCH_USE_CMPXCHG_LOCKREF
  lockref: use arch_mutex_cpu_relax() in CMPXCHG_LOOP()
  mutex: replace CONFIG_HAVE_ARCH_MUTEX_CPU_RELAX with simple ifdef
parents 3a126f85 efc1d23b
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -286,9 +286,6 @@ config HAVE_PERF_USER_STACK_DUMP
config HAVE_ARCH_JUMP_LABEL
	bool

config HAVE_ARCH_MUTEX_CPU_RELAX
	bool

config HAVE_RCU_TABLE_FREE
	bool

+1 −1
Original line number Diff line number Diff line
@@ -93,6 +93,7 @@ config S390
	select ARCH_INLINE_WRITE_UNLOCK_IRQ
	select ARCH_INLINE_WRITE_UNLOCK_IRQRESTORE
	select ARCH_SAVE_PAGE_KEYS if HIBERNATION
	select ARCH_USE_CMPXCHG_LOCKREF
	select ARCH_WANT_IPC_PARSE_VERSION
	select BUILDTIME_EXTABLE_SORT
	select CLONE_BACKWARDS2
@@ -102,7 +103,6 @@ config S390
	select GENERIC_TIME_VSYSCALL_OLD
	select HAVE_ALIGNED_STRUCT_PAGE if SLUB
	select HAVE_ARCH_JUMP_LABEL if !MARCH_G5
	select HAVE_ARCH_MUTEX_CPU_RELAX
	select HAVE_ARCH_SECCOMP_FILTER
	select HAVE_ARCH_TRACEHOOK
	select HAVE_ARCH_TRANSPARENT_HUGEPAGE if 64BIT
+0 −2
Original line number Diff line number Diff line
@@ -7,5 +7,3 @@
 */

#include <asm-generic/mutex-dec.h>

#define arch_mutex_cpu_relax()	barrier()
+2 −0
Original line number Diff line number Diff line
@@ -198,6 +198,8 @@ static inline void cpu_relax(void)
	barrier();
}

#define arch_mutex_cpu_relax()  barrier()

static inline void psw_set_key(unsigned int key)
{
	asm volatile("spka 0(%0)" : : "d" (key));
+5 −0
Original line number Diff line number Diff line
@@ -44,6 +44,11 @@ extern void arch_spin_lock_wait_flags(arch_spinlock_t *, unsigned long flags);
extern int arch_spin_trylock_retry(arch_spinlock_t *);
extern void arch_spin_relax(arch_spinlock_t *lock);

static inline int arch_spin_value_unlocked(arch_spinlock_t lock)
{
	return lock.owner_cpu == 0;
}

static inline void arch_spin_lock(arch_spinlock_t *lp)
{
	int old;
Loading