mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-27 17:11:46 +00:00
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>
This commit is contained in:
parent
7af7c616fa
commit
fba4b69771
9 changed files with 16 additions and 16 deletions
|
@ -34,7 +34,7 @@ int __init btrfs_delayed_inode_init(void)
|
|||
delayed_node_cache = kmem_cache_create("btrfs_delayed_node",
|
||||
sizeof(struct btrfs_delayed_node),
|
||||
0,
|
||||
SLAB_RECLAIM_ACCOUNT | SLAB_MEM_SPREAD,
|
||||
SLAB_MEM_SPREAD,
|
||||
NULL);
|
||||
if (!delayed_node_cache)
|
||||
return -ENOMEM;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue