summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/file.c
diff options
context:
space:
mode:
authorNikolay Borisov2016-06-23 20:17:08 +0200
committerDavid Sterba2016-07-26 13:52:25 +0200
commitfba4b697710eb2a4bee456b9d39e9239c66f8bee (patch)
treefdd49decee2eac671ab875c9b195fb3ec5730692 /fs/btrfs/file.c
parentBtrfs: use the correct struct for BTRFS_IOC_LOGICAL_INO (diff)
downloadkernel-qcow2-linux-fba4b697710eb2a4bee456b9d39e9239c66f8bee.tar.gz
kernel-qcow2-linux-fba4b697710eb2a4bee456b9d39e9239c66f8bee.tar.xz
kernel-qcow2-linux-fba4b697710eb2a4bee456b9d39e9239c66f8bee.zip
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/file.c')
-rw-r--r--fs/btrfs/file.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c
index bcfb4a27ddd4..38bea7bb0987 100644
--- a/fs/btrfs/file.c
+++ b/fs/btrfs/file.c
@@ -2975,7 +2975,7 @@ int btrfs_auto_defrag_init(void)
{
btrfs_inode_defrag_cachep = kmem_cache_create("btrfs_inode_defrag",
sizeof(struct inode_defrag), 0,
- SLAB_RECLAIM_ACCOUNT | SLAB_MEM_SPREAD,
+ SLAB_MEM_SPREAD,
NULL);
if (!btrfs_inode_defrag_cachep)
return -ENOMEM;