Skip to content
Commit dcf23ac3 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

locks: reinstate locks_delete_block optimization

There is measurable performance impact in some synthetic tests due to
commit 6d390e4b

 (locks: fix a potential use-after-free problem when
wakeup a waiter). Fix the race condition instead by clearing the
fl_blocker pointer after the wake_up, using explicit acquire/release
semantics.

This does mean that we can no longer use the clearing of fl_blocker as
the wait condition, so switch the waiters over to checking whether the
fl_blocked_member list_head is empty.

Reviewed-by: default avataryangerkun <yangerkun@huawei.com>
Reviewed-by: default avatarNeilBrown <neilb@suse.de>
Fixes: 6d390e4b

 (locks: fix a potential use-after-free problem when wakeup a waiter)
Signed-off-by: default avatarJeff Layton <jlayton@kernel.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 5076190d
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