]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: use generic slab for for btrfs_transaction
authorDavid Sterba <dsterba@suse.com>
Tue, 28 Mar 2017 10:06:05 +0000 (12:06 +0200)
committerDavid Sterba <dsterba@suse.com>
Mon, 19 Jun 2017 16:26:01 +0000 (18:26 +0200)
commit025e0f9503137bd646612ccc96847a7e0280daa7
treec0eedea1162f9b1f9c23dc4dc12b67928e5c7477
parent1eaa1165b7591bcda7f9d3b437d34bcb6cf52c5d
btrfs: use generic slab for for btrfs_transaction

Observing the number of slab objects of btrfs_transaction, there's just
one active on an almost quiescent filesystem, and the number of objects
goes to about ten when sync is in progress. Then the nubmer goes down to
1.  This matches the expectations of the transaction lifetime.

For such use the separate slab cache is not justified, as we do not
reuse objects frequently. For the shortlived transaction, the generic
slab (size 512) should be ok. We can optimistically expect that the 512
slabs are not all used (fragmentation) and there are free slots to take
when we do the allocation, compared to potentially allocating a whole new
page for the separate slab.

We'll lose the stats about the object use, which could be added later if
we really need them.

Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ctree.h
fs/btrfs/disk-io.c
fs/btrfs/inode.c
fs/btrfs/transaction.c