]> git.baikalelectronics.ru Git - kernel.git/commit
locks: reinstate locks_delete_block optimization
authorLinus Torvalds <torvalds@linux-foundation.org>
Wed, 18 Mar 2020 11:52:21 +0000 (07:52 -0400)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 18 Mar 2020 20:03:38 +0000 (13:03 -0700)
commit87e258525849729863b7d990f9a1d6064935ead2
treebcec3946a19e79751a97280bed14a633ad1a8ff8
parent77f1fec7bb5851768d46c2b4f7102741d1be96d8
locks: reinstate locks_delete_block optimization

There is measurable performance impact in some synthetic tests due to
commit ff4f38353bbf (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: yangerkun <yangerkun@huawei.com>
Reviewed-by: NeilBrown <neilb@suse.de>
Fixes: ff4f38353bbf (locks: fix a potential use-after-free problem when wakeup a waiter)
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/cifs/file.c
fs/locks.c