aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/backref.c
diff options
context:
space:
mode:
authorNikolay Borisov <n.borisov.lkml@gmail.com>2016-06-23 14:17:08 -0400
committerDavid Sterba <dsterba@suse.com>2016-07-26 07:52:25 -0400
commitfba4b697710eb2a4bee456b9d39e9239c66f8bee (patch)
treefdd49decee2eac671ab875c9b195fb3ec5730692 /fs/btrfs/backref.c
parent7af7c616fa2f1ce6c0d806b89898d2df098b4bd8 (diff)
btrfs: Fix slab accounting flags
BTRFS is using a variety of slab caches to satisfy internal needs. Those slab caches are always allocated with the SLAB_RECLAIM_ACCOUNT, meaning allocations from the caches are going to be accounted as SReclaimable. At the same time btrfs is not registering any shrinkers whatsoever, thus preventing memory from the slabs to be shrunk. This means those caches are not in fact reclaimable. To fix this remove the SLAB_RECLAIM_ACCOUNT on all caches apart from the inode cache, since this one is being freed by the generic VFS super_block shrinker. Also set the transaction related caches as SLAB_TEMPORARY, to better document the lifetime of the objects (it just translates to SLAB_RECLAIM_ACCOUNT). Signed-off-by: Nikolay Borisov <n.borisov.lkml@gmail.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/backref.c')
-rw-r--r--fs/btrfs/backref.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.c
index 8bb3509099e8..1ac8a3c7f68e 100644
--- a/fs/btrfs/backref.c
+++ b/fs/btrfs/backref.c
@@ -139,7 +139,7 @@ int __init btrfs_prelim_ref_init(void)
139 btrfs_prelim_ref_cache = kmem_cache_create("btrfs_prelim_ref", 139 btrfs_prelim_ref_cache = kmem_cache_create("btrfs_prelim_ref",
140 sizeof(struct __prelim_ref), 140 sizeof(struct __prelim_ref),
141 0, 141 0,
142 SLAB_RECLAIM_ACCOUNT | SLAB_MEM_SPREAD, 142 SLAB_MEM_SPREAD,
143 NULL); 143 NULL);
144 if (!btrfs_prelim_ref_cache) 144 if (!btrfs_prelim_ref_cache)
145 return -ENOMEM; 145 return -ENOMEM;