linux-sg2042/arch
Waiman Long a8654596f0 locking/rwsem: Enable lock event counting
Add lock event counting calls so that we can track the number of lock
events happening in the rwsem code.

With CONFIG_LOCK_EVENT_COUNTS on and booting a 4-socket 112-thread x86-64
system, the rwsem counts after system bootup were as follows:

  rwsem_opt_fail=261
  rwsem_opt_wlock=50636
  rwsem_rlock=445
  rwsem_rlock_fail=0
  rwsem_rlock_fast=22
  rwsem_rtrylock=810144
  rwsem_sleep_reader=441
  rwsem_sleep_writer=310
  rwsem_wake_reader=355
  rwsem_wake_writer=2335
  rwsem_wlock=261
  rwsem_wlock_fail=0
  rwsem_wtrylock=20583

It can be seen that most of the lock acquisitions in the slowpath were
write-locks in the optimistic spinning code path with no sleeping at
all. For this system, over 97% of the locks are acquired via optimistic
spinning. It illustrates the importance of optimistic spinning in
improving the performance of rwsem.

Signed-off-by: Waiman Long <longman@redhat.com>
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Acked-by: Davidlohr Bueso <dbueso@suse.de>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Davidlohr Bueso <dave@stgolabs.net>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Tim Chen <tim.c.chen@linux.intel.com>
Cc: Will Deacon <will.deacon@arm.com>
Link: http://lkml.kernel.org/r/20190404174320.22416-11-longman@redhat.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2019-04-10 10:56:06 +02:00
..
alpha locking/rwsem: Remove rwsem-spinlock.c & use rwsem-xadd.c for all archs 2019-04-03 14:50:52 +02:00
arc Merge branch 'linus' into locking/core, to pick up fixes 2019-04-10 09:14:42 +02:00
arm Merge branch 'linus' into locking/core, to pick up fixes 2019-04-10 09:14:42 +02:00
arm64 Merge branch 'linus' into locking/core, to pick up fixes 2019-04-10 09:14:42 +02:00
c6x Merge branch 'linus' into locking/core, to pick up fixes 2019-04-10 09:14:42 +02:00
csky Merge branch 'linus' into locking/core, to pick up fixes 2019-04-10 09:14:42 +02:00
h8300 Merge branch 'linus' into locking/core, to pick up fixes 2019-04-10 09:14:42 +02:00
hexagon Merge branch 'linus' into locking/core, to pick up fixes 2019-04-10 09:14:42 +02:00
ia64 Merge branch 'linus' into locking/core, to pick up fixes 2019-04-10 09:14:42 +02:00
m68k locking/rwsem: Remove rwsem-spinlock.c & use rwsem-xadd.c for all archs 2019-04-03 14:50:52 +02:00
microblaze Merge branch 'linus' into locking/core, to pick up fixes 2019-04-10 09:14:42 +02:00
mips Merge branch 'linus' into locking/core, to pick up fixes 2019-04-10 09:14:42 +02:00
nds32 Merge branch 'linus' into locking/core, to pick up fixes 2019-04-10 09:14:42 +02:00
nios2 Merge branch 'linus' into locking/core, to pick up fixes 2019-04-10 09:14:42 +02:00
openrisc Merge branch 'linus' into locking/core, to pick up fixes 2019-04-10 09:14:42 +02:00
parisc Merge branch 'linus' into locking/core, to pick up fixes 2019-04-10 09:14:42 +02:00
powerpc Merge branch 'linus' into locking/core, to pick up fixes 2019-04-10 09:14:42 +02:00
riscv Merge branch 'linus' into locking/core, to pick up fixes 2019-04-10 09:14:42 +02:00
s390 Merge branch 'linus' into locking/core, to pick up fixes 2019-04-10 09:14:42 +02:00
sh Merge branch 'linus' into locking/core, to pick up fixes 2019-04-10 09:14:42 +02:00
sparc Merge branch 'linus' into locking/core, to pick up fixes 2019-04-10 09:14:42 +02:00
um syscalls: Remove start and number from syscall_set_arguments() args 2019-04-05 09:27:23 -04:00
unicore32 locking/rwsem: Remove rwsem-spinlock.c & use rwsem-xadd.c for all archs 2019-04-03 14:50:52 +02:00
x86 locking/lock_events: Make lock_events available for all archs & other locks 2019-04-10 10:56:04 +02:00
xtensa Merge branch 'linus' into locking/core, to pick up fixes 2019-04-10 09:14:42 +02:00
.gitignore
Kconfig locking/rwsem: Enable lock event counting 2019-04-10 10:56:06 +02:00