• NeilBrown's avatar
    fs/locks: allow a lock request to block other requests. · 5946c431
    NeilBrown authored
    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>
    5946c431
locks.c 74.4 KB