Skip to content
Commit 5946c431 authored by NeilBrown's avatar NeilBrown Committed by Jeff Layton
Browse files

fs/locks: allow a lock request to block other requests.



Currently, a lock can block pending requests, but all pending
requests are equal.  If lots of pending requests are
mutually exclusive, this means they will all be woken up
and all but one will fail.  This can hurt performance.

So we will allow pending requests to block other requests.
Only the first request will be woken, and it will wake the others.

This patch doesn't implement this fully, but prepares the way.

- It acknowledges that a request might be blocking other requests,
  and when the request is converted to a lock, those blocked
  requests are moved across.
- When a request is requeued or discarded, all blocked requests are
  woken.
- When deadlock-detection looks for the lock which blocks a
  given request, we follow the chain of ->fl_blocker all
  the way to the top.

Tested-by: default avatarkernel test robot <rong.a.chen@intel.com>
Signed-off-by: default avatarNeilBrown <neilb@suse.com>
Reviewed-by: default avatarJ. Bruce Fields <bfields@redhat.com>
Signed-off-by: default avatarJeff Layton <jlayton@kernel.org>
parent d6367d62
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