ceph: fix performance regression due to ceph_d_revalidate fixes
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v3 Latest8 patches 5 repliesIn review
- v213 patches 10 repliesSuperseded
- v15 patches 0 repliesSuperseded
Patches in v3 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/8 | ceph: remove "Debugging hook" from ceph_fill_tracefs/ | +0 | 0 replies | |
| 2/8 | ceph: drop session argument to ceph_fill_tracefs/ fs/ fs/ | +4 | 0 replies | |
| 3/8 | ceph: convert bools in ceph_mds_request to a new r_req_flags fieldfs/ fs/ fs/ +2 more | +46 | 0 replies | |
| 4/8 | ceph: add a new flag to indicate whether parent is lockedfs/ fs/ fs/ +3 more | +42 | 2 replies | |
| 5/8 | ceph: don't update_dentry_lease unless we actually got onefs/ | +2 | 0 replies | |
| 6/8 | ceph: vet the target and parent inodes before updating dentry leasefs/ | +48 | 2 replies | |
| 7/8 | ceph: call update_dentry_lease even when r_locked dir is not setfs/ | +20 | 0 replies | |
| 8/8 | ceph: do a LOOKUP in d_revalidate instead of GETATTRfs/ | +3 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.
Cover letter [PATCH v3 0/8] ceph: fix performance regression due to ceph_d_revalidate fixes
v3: Squash bool to flag change patches, and better explain why we need to use atomic *_bit calls. Vet target and parent inodes when updating lease. Update lease properly on negative dentries (when is_target is 0). Also, update dentry leases even when call that triggered the request is cancelled.
v2: Fix a hang that would occasionally occur under fsstress
Zheng mentioned that he had gotten a report that testing with vdbench on a v4.8 kernel showed a large increase in the number of GETATTR calls being made. Since we had changed the d_revalidate code to use a GETATTR call and not set r_locked_dir in the request, the dentry lease wasn't getting updated from the traces, even when the MDS had granted one.
We need to use a LOOKUP when revalidating dentries so we can update the dentry lease if things look ok. That currently depends however on having r_locked_dir set to the parent directory.
In d_revalidate though, we may very well not hold the parent's i_rwsem. Manipulating the dcache is not allowed without it, but we can update the inode and the dentry leases.
The basic approach here is to separate r_locked_dir into an inode pointer representing the parent, and a flag indicating whether we know that it's locked (note that it _may_ still be locked even if that flag isn't set).
In ceph_fill_trace, we can then do all of the parts that don't require a locked parent whenever the parent pointer is set, but avoid the dcache manipulation when it isn't.
With this, dentry leases are again being updated as a result of d_revalidate lookups. The switch to using a flags fields instead of bools also shrinks the request size slightly.
Jeff Layton (8):
ceph: remove "Debugging hook" from ceph_fill_trace
ceph: drop session argument to ceph_fill_trace
ceph: convert bools in ceph_mds_request to a new r_req_flags field
ceph: add a new flag to indicate whether parent is locked
ceph: don't update_dentry_lease unless we actually got one
ceph: vet the target and parent inodes before updating dentry lease
ceph: call update_dentry_lease even when r_locked dir is not set
ceph: do a LOOKUP in d_revalidate instead of GETATTR
fs/ceph/debugfs.c | 2 +- fs/ceph/dir.c | 30 ++++++---- fs/ceph/export.c | 3 +- fs/ceph/file.c | 3 +- fs/ceph/inode.c | 164 ++++++++++++++++++++++++++++----------------------- fs/ceph/mds_client.c | 73 ++++++++++++----------- fs/ceph/mds_client.h | 15 +++-- fs/ceph/super.h | 3 +- 8 files changed, 162 insertions(+), 131 deletions(-)
Signature · 1 line
2.9.3