fs: amend SLAB_RECLAIM_ACCOUNT on gfs2 related slab cache
PATCH v2 1/1 fs: amend SLAB_RECLAIM_ACCOUNT on gfs2 related slab cache
From: Zhaoyang Huang <[email protected]>
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.
---
v2: add gfs2_glock_cachep for same operation
---
--- fs/gfs2/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fs/gfs2/main.c +2 -2
@@ -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;
Signature · 1 line
1.9.1
----- Original Message -----
Quoted 10 lines
From: Zhaoyang Huang <[email protected]>
As
gfs2_quotad_cachepandgfs2_glock_cachephave registered the shrinker, amendingSLAB_RECLAIM_ACCOUNTwhen creating them, which make the slab acount to be presiced.Signed-off-by Zhaoyang Huang <[email protected]>---
v2: addgfs2_glock_cachepfor same operation
---
Hi,
Thanks. Your patch is now pushed to the linux-gfs2/for-next branch. I cleaned up the description a bit. For example, I changed "fs:" to "gfs2:" to conform to other gfs2 patches.
Regards,
Bob Peterson
Bob,
Am Di., 5. Jan. 2021 um 14:28 Uhr schrieb Bob Peterson <[email protected]>:
Quoted 11 lines
----- Original Message -----
Quoted 10 lines
From: Zhaoyang Huang <[email protected]>
As
gfs2_quotad_cachepandgfs2_glock_cachephave registered the shrinker, amendingSLAB_RECLAIM_ACCOUNTwhen creating them, which make the slab acount to be presiced.Signed-off-by Zhaoyang Huang <[email protected]>---
v2: addgfs2_glock_cachepfor same operation
---
Quoted 5 lines
Hi,
Thanks. Your patch is now pushed to the linux-gfs2/for-next branch. I cleaned up the description a bit. For example, I changed "fs:" to "gfs2:" to conform to other gfs2 patches.
so the patch description now reads:
"As gfs2_quotad_cachep and gfs2_glock_cachep have registered shrinkers, amending SLAB_RECLAIM_ACCOUNT when creating them, which improves slab accounting."
I'm not sure what that description is based on; the definition of SLAB_RECLAIM_ACCOUNT in include/linux/slab.h looks as follows, which indicates that the purpose isn't really accounting but object grouping:
/* The following flags affect the page allocator grouping pages by mobility */ /* Objects are reclaimable */
#define SLAB_RECLAIM_ACCOUNT ((slab_flags_t __force)0x00020000U)
#define SLAB_TEMPORARY SLAB_RECLAIM_ACCOUNT /* Objects are
short-lived */
Furthermore, would it make sense to use SLAB_RECLAIM_ACCOUNT or SLAB_TEMPORARY for gfs2_bufdata and gfs2_trans as well?
Thanks,
Andreas