Skip to content

Commit

Permalink
ceph: Mark the file cache as unreclaimable
Browse files Browse the repository at this point in the history
Ceph creates multiple caches with the SLAB_RECLAIMABLE flag set, so
that it can satisfy its internal needs. Inspecting the code shows that
most of the caches are indeed reclaimable since they are directly
related to the generic inode/dentry shrinkers. However, one of the
cache used to satisfy struct file is not reclaimable since its
entries are freed only when the last reference to the file is
dropped. If a heavily loaded node opens a lot of files it can
introduce non-trivial discrepancies between memory shown as reclaimable
and what is actually reclaimed when drop_caches is used.

Fix this by removing the reclaimable flag for the file's cache.

Signed-off-by: Nikolay Borisov <n.borisov.lkml@gmail.com>
Signed-off-by: Yan, Zheng <zyan@redhat.com>
  • Loading branch information
Nikolay Borisov authored and Ilya Dryomov committed Jul 28, 2016
1 parent c8799fc commit 6b1a9a6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/ceph/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -686,8 +686,8 @@ static int __init init_caches(void)
if (ceph_dentry_cachep == NULL)
goto bad_dentry;

ceph_file_cachep = KMEM_CACHE(ceph_file_info,
SLAB_RECLAIM_ACCOUNT|SLAB_MEM_SPREAD);
ceph_file_cachep = KMEM_CACHE(ceph_file_info, SLAB_MEM_SPREAD);

if (ceph_file_cachep == NULL)
goto bad_file;

Expand Down

0 comments on commit 6b1a9a6

Please sign in to comment.