Re: [PATCH-tip v2 00/10] locking/rwsem: Rwsem rearchitecture part 1

From: Davidlohr Bueso
Date: Tue Feb 26 2019 - 13:20:25 EST


On Fri, 15 Feb 2019, Waiman Long wrote:

v2:
- Sync up to v4 of the part 0 patch.
- Remove the rwsem.h->rwsem-xadd.h renaming patch & change patches
to modify rwsem.h instead of rwsem-xadd.h.
- Add a new patch to micro-optimize rwsem_try_read_lock_unqueued().

This is part 1 of a 3-part (0/1/2) series to rearchitect the internal
operation of rwsem. This depends on the v4 part 0 patches sent out
previously

https://lore.kernel.org/lkml/1550095217-12047-1-git-send-email-longman@xxxxxxxxxx

This part lays the foundation for part 2 without making any functional
changes. This part includes the following changes:

1) Move code around and micro-optimize rwsem_try_read_lock_unqueued()
(patches 1-4).
2) Enhance the DEBUG_RWSEMS_WARN_ON() macro to provide more information
and add additional checks (patches 5 & 6).
3) Make the core qspinlock_stat.h code generic (lock event counting)
so that it can be used by all the architectures as well as other
locking subsystems such as rwsem (patches 7-10). Lock event
counting help us visualize how frequently a code path is being
used as well as spotting abnormal behavior due to bugs in the code
without noticeably affecting kernel performance and hence behavior.

Both (2) and (3) are useful debugging aids.

Yes, this will come in handy in the future. Feel free to add my:

Acked-by: Davidlohr Bueso <dbueso@xxxxxxx>

Thanks.