Skip to content

ceph: fix performance regression due to ceph_d_revalidate fixes

Jeff Layton ceph-devel 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest8 patches 5 repliesIn review
  2. v213 patches 10 repliesSuperseded
  3. v15 patches 0 repliesSuperseded

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8ceph: remove "Debugging hook" from ceph_fill_tracefs/ceph/inode.c+0 -340 replies
2/8ceph: drop session argument to ceph_fill_tracefs/ceph/inode.c fs/ceph/mds_client.c fs/ceph/super.h+4 -50 replies
3/8ceph: convert bools in ceph_mds_request to a new r_req_flags fieldfs/ceph/debugfs.c fs/ceph/dir.c fs/ceph/inode.c +2 more+46 -380 replies
4/8ceph: add a new flag to indicate whether parent is lockedfs/ceph/dir.c fs/ceph/export.c fs/ceph/file.c +3 more+42 -292 replies
5/8ceph: don't update_dentry_lease unless we actually got onefs/ceph/inode.c+2 -20 replies
6/8ceph: vet the target and parent inodes before updating dentry leasefs/ceph/inode.c+48 -242 replies
7/8ceph: call update_dentry_lease even when r_locked dir is not setfs/ceph/inode.c+20 -00 replies
8/8ceph: do a LOOKUP in d_revalidate instead of GETATTRfs/ceph/dir.c+3 -20 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

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