Skip to content

mds: some optimizations around client Capability and Lease tracking#57911

Merged
vshankar merged 4 commits intoceph:mainfrom
gardran:wip-gdran-mds-better-clease-handling
Aug 8, 2024
Merged

mds: some optimizations around client Capability and Lease tracking#57911
vshankar merged 4 commits intoceph:mainfrom
gardran:wip-gdran-mds-better-clease-handling

Conversation

@gardran
Copy link
Contributor

@gardran gardran commented Jun 6, 2024

This is a partial revival of @ukernel's optimization PR: #43126
which has

  • reducing RAM consumption in Capability tracking.
  • doing some performance optimization in ClientLease tracking.
  • optimize sending cap messages by using target session directly instead of looking it up through Inode's client_caps.

The last commit from myself switches ClientLease tracking from std::map to boost::intrusive::set to reduce amount of lookups over client_leases collection .

Contribution Guidelines

  • To sign and title your commits, please refer to Submitting Patches to Ceph.

  • If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.

  • When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an x between the brackets: [x]. Spaces and capitalization matter when checking off items this way.

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands
  • jenkins retest this please
  • jenkins test classic perf
  • jenkins test crimson perf
  • jenkins test signed
  • jenkins test make check
  • jenkins test make check arm64
  • jenkins test submodules
  • jenkins test dashboard
  • jenkins test dashboard cephadm
  • jenkins test api
  • jenkins test docs
  • jenkins render docs
  • jenkins test ceph-volume all
  • jenkins test ceph-volume tox
  • jenkins test windows
  • jenkins test rook e2e

@github-actions github-actions bot added the cephfs Ceph File System label Jun 6, 2024
@markhpc markhpc self-requested a review June 6, 2024 14:48
Yan, Zheng added 2 commits June 10, 2024 13:21
Signed-off-by: "Yan, Zheng" <yanzheng03@kuaishou.com>
Signed-off-by: "Yan, Zheng" <yanzheng03@kuaishou.com>
@gardran gardran force-pushed the wip-gdran-mds-better-clease-handling branch from 22ccc65 to 2b258f9 Compare June 10, 2024 10:36
@batrick batrick self-requested a review June 11, 2024 17:17
Yan, Zheng and others added 2 commits June 24, 2024 20:18
Signed-off-by: "Yan, Zheng" <yanzheng03@kuaishou.com>
This allows to avoid additional redundant lookups in CDentry::client_leases
for some scenarios, e.g.:
* CDentry::remove_client_lease() is called from CDentry::remove_client_leases().
* CDentry::remove_client_lease() is called from Locker::remove_stale_leases()
* CDentry::remove_client_lease() is called from Locker::process_request_cap_release()

And a few similar cases.
In all of them a caller has a pointer to ClientLease object but has to
perform another lookup to remove that lease.

Signed-off-by: Garry Drankovich <garry.drankovich@clyso.com>
@gardran gardran force-pushed the wip-gdran-mds-better-clease-handling branch from 2b258f9 to 2140fbf Compare June 24, 2024 17:19
@vshankar vshankar requested a review from a team July 1, 2024 11:53

elist<CInode*> inodes_with_caps; // for efficient realm splits
std::map<client_t, xlist<Capability*>* > client_caps; // to identify clients who need snap notifications
std::map<client_t, elist<Capability*> > client_caps; // to identify clients who need snap notifications
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a nice saving. Just for information sake, here is the size difference:

16 elist<>::item
32 xlist<>::item

This is from a sample MDS log (main branch build) that dumps struct sizes on start. 👍

@vshankar
Copy link
Contributor

vshankar commented Jul 5, 2024

This PR is under test in https://tracker.ceph.com/issues/66850.

@vshankar
Copy link
Contributor

This PR is under test in https://tracker.ceph.com/issues/67089.

@vshankar
Copy link
Contributor

I'm seeing some new failures in the branch which this PR is a part of. Trying to isolate the problematic change. Will update when done.

@gardran
Copy link
Contributor Author

gardran commented Jul 30, 2024

jenkins test api

Copy link
Contributor

@vshankar vshankar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vshankar vshankar merged commit 5ba8c92 into ceph:main Aug 8, 2024
@gardran gardran deleted the wip-gdran-mds-better-clease-handling branch August 8, 2024 10:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants