diff options
author | Paul E. McKenney <paulmck@kernel.org> | 2021-06-02 16:04:11 -0700 |
---|---|---|
committer | Paul E. McKenney <paulmck@kernel.org> | 2021-07-27 11:39:30 -0700 |
commit | af5f6e27d52cdb2cb3826df19a69a74e9d5eff5e (patch) | |
tree | 751ec15273f6780b99c1a1b0b199c5dcafbe7dc5 /kernel/scftorture.c | |
parent | 5b237d650eb8b0870b5d816fecc0be00237cbfff (diff) |
locktorture: Count lock readers
Currently, the lock_is_read_held variable is bool, so that a reader sets
it to true just after lock acquisition and then to false just before
lock release. This works in a rough statistical sense, but can result
in false negatives just after one of a pair of concurrent readers has
released the lock. This approach does have low overhead, but at the
expense of the setting to true potentially never leaving the reader's
store buffer, thus resulting in an unconditional false negative.
This commit therefore converts this variable to atomic_t and makes
the reader use atomic_inc() just after acquisition and atomic_dec()
just before release. This does increase overhead, but this increase is
negligible compared to the 10-microsecond lock hold time.
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Diffstat (limited to 'kernel/scftorture.c')
0 files changed, 0 insertions, 0 deletions