diff options
author | David Howells <dhowells@redhat.com> | 2021-09-02 23:51:01 +0300 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2021-09-13 11:10:39 +0300 |
commit | 4fe6a946823a9bc8619fd16b7ea7d15914a30f22 (patch) | |
tree | 93909a3b3be722dc66e36609ec31db144cdd8c35 /fs/afs/protocol_yfs.h | |
parent | 6e0e99d58a6530cf65f10e4bb16630c5be6c254d (diff) | |
download | linux-4fe6a946823a9bc8619fd16b7ea7d15914a30f22.tar.xz |
afs: Try to avoid taking RCU read lock when checking vnode validity
Try to avoid taking the RCU read lock when checking the validity of a
vnode's callback state. The only thing it's needed for is to pin the
parent volume's server list whilst we search it to find the record of the
server we're currently using to see if it has been reinitialised (ie. it
sent us a CB.InitCallBackState* RPC).
Do this by the following means:
(1) Keep an additional per-cell counter (fs_s_break) that's incremented
each time any of the fileservers in the cell reinitialises.
Since the new counter can be accessed without RCU from the vnode, we
can check that first - and only if it differs, get the RCU read lock
and check the volume's server list.
(2) Replace afs_get_s_break_rcu() with afs_check_server_good() which now
indicates whether the callback promise is still expected to be present
on the server. This does the checks as described in (1).
(3) Restructure afs_check_validity() to take account of the change in (2).
We can also get rid of the valid variable and just use the need_clear
variable with the addition of the afs_cb_break_no_promise reason.
(4) afs_check_validity() probably shouldn't be altering vnode->cb_v_break
and vnode->cb_s_break when it doesn't have cb_lock exclusively locked.
Move the change to vnode->cb_v_break to __afs_break_callback().
Delegate the change to vnode->cb_s_break to afs_select_fileserver()
and set vnode->cb_fs_s_break there also.
(5) afs_validate() no longer needs to get the RCU read lock around its
call to afs_check_validity() - and can skip the call entirely if we
don't have a promise.
Signed-off-by: David Howells <dhowells@redhat.com>
Tested-by: Markus Suvanto <markus.suvanto@gmail.com>
cc: linux-afs@lists.infradead.org
Link: https://lore.kernel.org/r/163111669583.283156.1397603105683094563.stgit@warthog.procyon.org.uk/
Diffstat (limited to 'fs/afs/protocol_yfs.h')
0 files changed, 0 insertions, 0 deletions