diff options
| -rw-r--r-- | drivers/md/dm.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/md/dm.c b/drivers/md/dm.c index 7b0ccdc5d65c..f2e5a50ee84e 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c | |||
| @@ -211,7 +211,8 @@ struct dm_md_mempools { | |||
| 211 | struct bio_set *bs; | 211 | struct bio_set *bs; |
| 212 | }; | 212 | }; |
| 213 | 213 | ||
| 214 | #define MIN_IOS 256 | 214 | #define RESERVED_BIO_BASED_IOS 16 |
| 215 | #define RESERVED_REQUEST_BASED_IOS 256 | ||
| 215 | static struct kmem_cache *_io_cache; | 216 | static struct kmem_cache *_io_cache; |
| 216 | static struct kmem_cache *_rq_tio_cache; | 217 | static struct kmem_cache *_rq_tio_cache; |
| 217 | 218 | ||
| @@ -2873,18 +2874,18 @@ struct dm_md_mempools *dm_alloc_md_mempools(unsigned type, unsigned integrity, u | |||
| 2873 | 2874 | ||
| 2874 | if (type == DM_TYPE_BIO_BASED) { | 2875 | if (type == DM_TYPE_BIO_BASED) { |
| 2875 | cachep = _io_cache; | 2876 | cachep = _io_cache; |
| 2876 | pool_size = 16; | 2877 | pool_size = RESERVED_BIO_BASED_IOS; |
| 2877 | front_pad = roundup(per_bio_data_size, __alignof__(struct dm_target_io)) + offsetof(struct dm_target_io, clone); | 2878 | front_pad = roundup(per_bio_data_size, __alignof__(struct dm_target_io)) + offsetof(struct dm_target_io, clone); |
| 2878 | } else if (type == DM_TYPE_REQUEST_BASED) { | 2879 | } else if (type == DM_TYPE_REQUEST_BASED) { |
| 2879 | cachep = _rq_tio_cache; | 2880 | cachep = _rq_tio_cache; |
| 2880 | pool_size = MIN_IOS; | 2881 | pool_size = RESERVED_REQUEST_BASED_IOS; |
| 2881 | front_pad = offsetof(struct dm_rq_clone_bio_info, clone); | 2882 | front_pad = offsetof(struct dm_rq_clone_bio_info, clone); |
| 2882 | /* per_bio_data_size is not used. See __bind_mempools(). */ | 2883 | /* per_bio_data_size is not used. See __bind_mempools(). */ |
| 2883 | WARN_ON(per_bio_data_size != 0); | 2884 | WARN_ON(per_bio_data_size != 0); |
| 2884 | } else | 2885 | } else |
| 2885 | goto out; | 2886 | goto out; |
| 2886 | 2887 | ||
| 2887 | pools->io_pool = mempool_create_slab_pool(MIN_IOS, cachep); | 2888 | pools->io_pool = mempool_create_slab_pool(pool_size, cachep); |
| 2888 | if (!pools->io_pool) | 2889 | if (!pools->io_pool) |
| 2889 | goto out; | 2890 | goto out; |
| 2890 | 2891 | ||
