The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Huangzhaoyang <huangzhaoyang@gmail.com>
To: Bob Peterson <rpeterso@redhat.com>,
	Andreas Gruenbacher <agruenba@redhat.com>,
	cluster-devel@redhat.com,
	Zhaoyang Huang <zhaoyang.huang@unisoc.com>,
	linux-kernel@vger.kernel.org
Subject: [PATCH v2] fs: amend SLAB_RECLAIM_ACCOUNT on gfs2 related slab cache
Date: Tue,  5 Jan 2021 08:47:22 +0800	[thread overview]
Message-ID: <1609807642-31552-1-git-send-email-huangzhaoyang@gmail.com> (raw)

From: Zhaoyang Huang <zhaoyang.huang@unisoc.com>

As gfs2_quotad_cachep and gfs2_glock_cachep have registered
the shrinker, amending SLAB_RECLAIM_ACCOUNT when creating
them, which make the slab acount to be presiced.

Signed-off-by: Zhaoyang Huang <zhaoyang.huang@unisoc.com>
---
v2: add gfs2_glock_cachep for same operation
---
---
 fs/gfs2/main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/gfs2/main.c b/fs/gfs2/main.c
index 136484e..23144a7 100644
--- a/fs/gfs2/main.c
+++ b/fs/gfs2/main.c
@@ -100,7 +100,7 @@ static int __init init_gfs2_fs(void)
 	error = -ENOMEM;
 	gfs2_glock_cachep = kmem_cache_create("gfs2_glock",
 					      sizeof(struct gfs2_glock),
-					      0, 0,
+					      0, SLAB_RECLAIM_ACCOUNT,
 					      gfs2_init_glock_once);
 	if (!gfs2_glock_cachep)
 		goto fail_cachep1;
@@ -136,7 +136,7 @@ static int __init init_gfs2_fs(void)
 
 	gfs2_quotad_cachep = kmem_cache_create("gfs2_quotad",
 					       sizeof(struct gfs2_quota_data),
-					       0, 0, NULL);
+					       0, SLAB_RECLAIM_ACCOUNT, NULL);
 	if (!gfs2_quotad_cachep)
 		goto fail_cachep6;
 
-- 
1.9.1


             reply	other threads:[~2021-01-05  0:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-05  0:47 Huangzhaoyang [this message]
2021-01-05 12:54 ` [PATCH v2] fs: amend SLAB_RECLAIM_ACCOUNT on gfs2 related slab cache Bob Peterson
2021-01-05 21:07   ` Andreas Grünbacher

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1609807642-31552-1-git-send-email-huangzhaoyang@gmail.com \
    --to=huangzhaoyang@gmail.com \
    --cc=agruenba@redhat.com \
    --cc=cluster-devel@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rpeterso@redhat.com \
    --cc=zhaoyang.huang@unisoc.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox