Commit 84a37cbf authored by Kent Overstreet's avatar Kent Overstreet

six locks: Wakeup now takes lock on behalf of waiter

This brings back an important optimization, to avoid touching the wait
lists an extra time, while preserving the property that a thread is on a
lock waitlist iff it is waiting - it is never removed from the waitlist
until it has the lock.
Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent e4b7254c
This diff is collapsed.
......@@ -110,11 +110,10 @@ struct six_lock {
union six_lock_state state;
unsigned intent_lock_recurse;
struct task_struct *owner;
unsigned __percpu *readers;
#ifdef CONFIG_SIX_LOCK_SPIN_ON_OWNER
struct optimistic_spin_queue osq;
#endif
unsigned __percpu *readers;
raw_spinlock_t wait_lock;
struct list_head wait_list;
#ifdef CONFIG_DEBUG_LOCK_ALLOC
......@@ -126,6 +125,7 @@ struct six_lock_waiter {
struct list_head list;
struct task_struct *task;
enum six_lock_type lock_want;
bool lock_acquired;
u64 start_time;
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment