From: Mark Nelson Date: Fri, 24 Jul 2020 05:29:15 +0000 (+0000) Subject: mds/CInode: Optimize only pinned by subtrees check X-Git-Tag: v17.0.0~1616^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=6a865f805b723525358ed8e79bb3d41709e98bf3;p=ceph.git mds/CInode: Optimize only pinned by subtrees check Fixes: https://tracker.ceph.com/issues/46727 Signed-off-by: Mark Nelson --- diff --git a/src/mds/CInode.h b/src/mds/CInode.h index 1e055cf99f9db..60da4fb98765f 100644 --- a/src/mds/CInode.h +++ b/src/mds/CInode.h @@ -579,6 +579,9 @@ class CInode : public MDSCacheObject, public InodeStoreBase, public Counter MDCache::trim(uint64_t count) } } else if (!diri->is_auth() && dir->get_num_ref() <= 1) { // only subtree pin - auto&& ls = diri->get_subtree_dirfrags(); - if (diri->get_num_ref() > (int)ls.size()) // only pinned by subtrees + if (diri->get_num_ref() > diri->get_num_subtree_roots()) { continue; + } // don't trim subtree root if its auth MDS is recovering. // This simplify the cache rejoin code.