]> git.hungrycats.org Git - linux/commit
btrfs: don't use slab cache for struct btrfs_delalloc_work
authorDavid Sterba <dsterba@suse.com>
Tue, 8 Dec 2015 13:39:32 +0000 (14:39 +0100)
committerZygo Blaxell <zblaxell@serenity.furryterror.org>
Tue, 19 Jan 2016 05:27:22 +0000 (00:27 -0500)
commit453961ff69fbb9a15e4a3d77082da8e5608b7467
tree38432bb048176d23fa4f01cb638babcda7bf53ca
parent29a661504fc555947c139816f556ad15476a91a5
btrfs: don't use slab cache for struct btrfs_delalloc_work

Although we prefer to use separate caches for various structs, it seems
better not to do that for struct btrfs_delalloc_work. Objects of this
type are allocated rarely, when transaction commit calls
btrfs_start_delalloc_roots, requesting delayed iputs.

The objects are temporary (with some IO involved) but still allocated
and freed within __start_delalloc_inodes. Memory allocation failure is
handled.

The slab cache is empty most of the time (observed on several systems),
so if we need to allocate a new slab object, the first one has to
allocate a full page. In a potential case of low memory conditions this
might fail with higher probability compared to using the generic slab
caches.

Signed-off-by: David Sterba <dsterba@suse.com>
(cherry picked from commit 100d57025cce6bf568a10660c0d884bcc64c580e)
(cherry picked from commit 39d3a1edd0817bd727b46318997c8e56ff25c249)
fs/btrfs/inode.c