]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
mds: use mempool for cache objects
authorPatrick Donnelly <pdonnell@redhat.com>
Fri, 28 Jul 2017 00:21:54 +0000 (17:21 -0700)
committerPatrick Donnelly <pdonnell@redhat.com>
Thu, 14 Sep 2017 03:22:06 +0000 (20:22 -0700)
commit2ef222a58c3801eaac5a6d52dda2de1ffe37407b
tree06784f29be02df87cd0cd8f72c69f17a982083c8
parentf26412883c390b78df132e32d99afa5a14c525f3
mds: use mempool for cache objects

The purpose of this is to allow us to track memory usage by cached objects so
we can limit cache size based on memory available/allocated to the MDS.

This commit is a first step: it adds CInode, CDir, and CDentry to the mempool
but not all of the containers in these classes (e.g. std::map). However,
MDSCacheObject has been changed to allocate its containers through the mempool
by converting compact_* containers to the std versions offered through mempool
via the new alloc_ptr.

(A compact_* class simply wraps a pointer to the std:: version to reduce memory
usage of an object when the container is only occasionally used. The alloc_ptr
allows us to achieve the same thing explicitly with only a little handholding:
when all entries in the wrapped container are deleted, the caller must call
alloc_ptr.release().)

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
(cherry picked from commit e035b64fcb0482c3318656e1680d683814f494fe)
13 files changed:
src/include/mempool.h
src/mds/CDentry.cc
src/mds/CDentry.h
src/mds/CDir.cc
src/mds/CDir.h
src/mds/CInode.cc
src/mds/CInode.h
src/mds/MDCache.cc
src/mds/MDCache.h
src/mds/MDSCacheObject.cc
src/mds/MDSCacheObject.h
src/mds/MDSDaemon.cc
src/mds/MDSRank.cc