kernel_optimize_test/kernel/locking
Waiman Long 51816e9e11 locking/lock_events: Use this_cpu_add() when necessary
The kernel test robot has reported that the use of __this_cpu_add()
causes bug messages like:

  BUG: using __this_cpu_add() in preemptible [00000000] code: ...

Given the imprecise nature of the count and the possibility of resetting
the count and doing the measurement again, this is not really a big
problem to use the unprotected __this_cpu_*() functions.

To make the preemption checking code happy, the this_cpu_*() functions
will be used if CONFIG_DEBUG_PREEMPT is defined.

The imprecise nature of the locking counts are also documented with
the suggestion that we should run the measurement a few times with the
counts reset in between to get a better picture of what is going on
under the hood.

Fixes: a8654596f0 ("locking/rwsem: Enable lock event counting")
Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Waiman Long <longman@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2019-05-24 14:17:18 -07:00
..
lock_events_list.h locking/rwsem: Enable lock event counting 2019-04-10 10:56:06 +02:00
lock_events.c locking/lock_events: Don't show pvqspinlock events on bare metal 2019-04-10 10:56:05 +02:00
lock_events.h locking/lock_events: Use this_cpu_add() when necessary 2019-05-24 14:17:18 -07:00
lockdep_internals.h locking/lockdep: Test all incompatible scenarios at once in check_irq_usage() 2019-04-29 08:29:20 +02:00
lockdep_proc.c locking/lockdep: Introduce lockdep_next_lockchain() and lock_chain_count() 2019-02-28 07:55:44 +01:00
lockdep_states.h
lockdep.c treewide: Add SPDX license identifier for missed files 2019-05-21 10:50:45 +02:00
locktorture.c locktorture: NULL cxt.lwsa and cxt.lrsa to allow bad-arg detection 2019-03-26 14:42:53 -07:00
Makefile locking/lock_events: Make lock_events available for all archs & other locks 2019-04-10 10:56:04 +02:00
mcs_spinlock.h
mutex-debug.c locking/mutex: Replace spin_is_locked() with lockdep 2018-11-12 09:06:22 -08:00
mutex-debug.h
mutex.c treewide: Add SPDX license identifier for missed files 2019-05-21 10:50:45 +02:00
mutex.h
osq_lock.c
percpu-rwsem.c treewide: Add SPDX license identifier for missed files 2019-05-21 10:50:45 +02:00
qrwlock.c
qspinlock_paravirt.h locking/qspinlock_stat: Introduce generic lockevent_*() counting APIs 2019-04-10 10:56:03 +02:00
qspinlock_stat.h locking/lock_events: Make lock_events available for all archs & other locks 2019-04-10 10:56:04 +02:00
qspinlock.c locking/qspinlock_stat: Introduce generic lockevent_*() counting APIs 2019-04-10 10:56:03 +02:00
rtmutex_common.h
rtmutex-debug.c
rtmutex-debug.h
rtmutex.c treewide: Add SPDX license identifier for missed files 2019-05-21 10:50:45 +02:00
rtmutex.h
rwsem-xadd.c locking/rwsem: Prevent decrement of reader count before increment 2019-05-07 08:46:46 +02:00
rwsem.c locking/rwsem: Enhance DEBUG_RWSEMS_WARN_ON() macro 2019-04-10 10:56:03 +02:00
rwsem.h locking/rwsem: Prevent unneeded warning during locking selftest 2019-04-14 11:09:35 +02:00
semaphore.c
spinlock_debug.c mmiowb: Hook up mmiowb helpers to spinlocks and generic I/O accessors 2019-04-08 11:59:47 +01:00
spinlock.c asm-generic/mmiowb: Add generic implementation of mmiowb() tracking 2019-04-08 11:59:39 +01:00
test-ww_mutex.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 9 2019-05-21 11:28:40 +02:00