mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-28 13:22:57 +00:00
six locks: Lock contended tracepoints
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
parent
ee526b88ca
commit
20e425d301
1 changed files with 6 additions and 2 deletions
|
@ -11,6 +11,8 @@
|
|||
#include <linux/sched/task.h>
|
||||
#include <linux/slab.h>
|
||||
|
||||
#include <trace/events/lock.h>
|
||||
|
||||
#include "six.h"
|
||||
|
||||
#ifdef DEBUG
|
||||
|
@ -462,11 +464,12 @@ static int six_lock_slowpath(struct six_lock *lock, enum six_lock_type type,
|
|||
smp_mb__after_atomic();
|
||||
}
|
||||
|
||||
trace_contention_begin(lock, 0);
|
||||
lock_contended(&lock->dep_map, ip);
|
||||
|
||||
if (six_optimistic_spin(lock, type))
|
||||
goto out;
|
||||
|
||||
lock_contended(&lock->dep_map, ip);
|
||||
|
||||
wait->task = current;
|
||||
wait->lock_want = type;
|
||||
wait->lock_acquired = false;
|
||||
|
@ -546,6 +549,7 @@ static int six_lock_slowpath(struct six_lock *lock, enum six_lock_type type,
|
|||
six_clear_bitmask(lock, SIX_LOCK_HELD_write);
|
||||
six_lock_wakeup(lock, atomic_read(&lock->state), SIX_LOCK_read);
|
||||
}
|
||||
trace_contention_end(lock, 0);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue