Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1449658 > unrolled thread

[PATCH] ceph: Mark the file cache as unreclaimable

Started byNikolay Borisov <n.borisov.lkml@gmail.com>
First post2016-07-25 19:10 +0200
Last post2016-07-26 04:30 +0200
Articles 3 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] ceph: Mark the file cache as unreclaimable Nikolay Borisov <n.borisov.lkml@gmail.com> - 2016-07-25 19:10 +0200
    [PATCH v2] ceph: Mark the file cache as unreclaimable Nikolay Borisov <n.borisov.lkml@gmail.com> - 2016-07-25 19:20 +0200
      Re: [PATCH v2] ceph: Mark the file cache as unreclaimable "Yan, Zheng" <zyan@redhat.com> - 2016-07-26 04:30 +0200

#1449658 — [PATCH] ceph: Mark the file cache as unreclaimable

FromNikolay Borisov <n.borisov.lkml@gmail.com>
Date2016-07-25 19:10 +0200
Subject[PATCH] ceph: Mark the file cache as unreclaimable
Message-ID<rYRy9-7fs-1@gated-at.bofh.it>
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.
---
 fs/ceph/super.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/ceph/super.c b/fs/ceph/super.c
index 91e02481ce06..a8a6908078ee 100644
--- a/fs/ceph/super.c
+++ b/fs/ceph/super.c
@@ -672,8 +672,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;
 
-- 
2.7.4

[toc] | [next] | [standalone]


#1449663 — [PATCH v2] ceph: Mark the file cache as unreclaimable

FromNikolay Borisov <n.borisov.lkml@gmail.com>
Date2016-07-25 19:20 +0200
Subject[PATCH v2] ceph: Mark the file cache as unreclaimable
Message-ID<rYRHP-7ix-5@gated-at.bofh.it>
In reply to#1449658
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>
---

Fixed checkpatch warning + missing SOB line

 fs/ceph/super.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/ceph/super.c b/fs/ceph/super.c
index 91e02481ce06..8697cac6add0 100644
--- a/fs/ceph/super.c
+++ b/fs/ceph/super.c
@@ -672,8 +672,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;
 
-- 
2.7.4

[toc] | [prev] | [next] | [standalone]


#1450329 — Re: [PATCH v2] ceph: Mark the file cache as unreclaimable

From"Yan, Zheng" <zyan@redhat.com>
Date2016-07-26 04:30 +0200
SubjectRe: [PATCH v2] ceph: Mark the file cache as unreclaimable
Message-ID<rZ0i5-4Aj-7@gated-at.bofh.it>
In reply to#1449663
> On Jul 26, 2016, at 01:12, Nikolay Borisov <n.borisov.lkml@gmail.com> wrote:
> 
> 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>
> ---
> 
> Fixed checkpatch warning + missing SOB line
> 
> fs/ceph/super.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/ceph/super.c b/fs/ceph/super.c
> index 91e02481ce06..8697cac6add0 100644
> --- a/fs/ceph/super.c
> +++ b/fs/ceph/super.c
> @@ -672,8 +672,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;
> 

Applied, thanks

Yan, Zheng

> -- 
> 2.7.4
> 

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web