mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
block: Require subsystems to explicitly allocate bio_set integrity mempool
MD and DM create a new bio_set for every metadevice. Each bio_set has an integrity mempool attached regardless of whether the metadevice is capable of passing integrity metadata. This is a waste of memory. Instead we defer the allocation decision to MD and DM since we know at metadevice creation time whether integrity passthrough is needed or not. Automatic integrity mempool allocation can then be removed from bioset_create() and we make an explicit integrity allocation for the fs_bio_set. Signed-off-by: Martin K. Petersen <[email protected]> Reported-by: Zdenek Kabelac <[email protected]> Acked-by: Mike Snitzer <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
This commit is contained in:
parent
82f04ab47e
commit
a91a2785b2
11 changed files with 41 additions and 22 deletions
6
fs/bio.c
6
fs/bio.c
|
|
@ -1636,9 +1636,6 @@ struct bio_set *bioset_create(unsigned int pool_size, unsigned int front_pad)
|
|||
if (!bs->bio_pool)
|
||||
goto bad;
|
||||
|
||||
if (bioset_integrity_create(bs, pool_size))
|
||||
goto bad;
|
||||
|
||||
if (!biovec_create_pools(bs, pool_size))
|
||||
return bs;
|
||||
|
||||
|
|
@ -1682,6 +1679,9 @@ static int __init init_bio(void)
|
|||
if (!fs_bio_set)
|
||||
panic("bio: can't allocate bios\n");
|
||||
|
||||
if (bioset_integrity_create(fs_bio_set, BIO_POOL_SIZE))
|
||||
panic("bio: can't create integrity pool\n");
|
||||
|
||||
bio_split_pool = mempool_create_kmalloc_pool(BIO_SPLIT_ENTRIES,
|
||||
sizeof(struct bio_pair));
|
||||
if (!bio_split_pool)
|
||||
|
|
|
|||
Loading…
Reference in a new issue