diff options
author | Milan Broz <mbroz@redhat.com> | 2006-09-04 09:37:57 -0400 |
---|---|---|
committer | Jens Axboe <axboe@nelson.home.kernel.dk> | 2006-09-30 14:52:33 -0400 |
commit | 50be345560f1ffdcb15cc0e146416b80529a2ef2 (patch) | |
tree | 056278d82ea7fcbd26d9cc95c806d3978bbbb56e | |
parent | bcfd8d36151e531e1c6c731f1fbf792509a1c494 (diff) |
[PATCH] fix creating zero sized bio mempools in low memory system
In the very low memory systems is in the init_bio call
scale parameter set to zero and it leads to creating
zero sized mempool.
This patch prevents pool_entries parameter become zero,
so the created pool have at least 1 entry.
Mempool with 0 entries lead to incorrect behaviour
of mempool_free. (Alloc requests are not waken up
and system stalls in mempool_alloc->ioschedule).
Signed-off-by: Milan Broz <mbroz@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r-- | fs/bio.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -1142,7 +1142,7 @@ static int biovec_create_pools(struct bio_set *bs, int pool_entries, int scale) | |||
1142 | struct biovec_slab *bp = bvec_slabs + i; | 1142 | struct biovec_slab *bp = bvec_slabs + i; |
1143 | mempool_t **bvp = bs->bvec_pools + i; | 1143 | mempool_t **bvp = bs->bvec_pools + i; |
1144 | 1144 | ||
1145 | if (i >= scale) | 1145 | if (pool_entries > 1 && i >= scale) |
1146 | pool_entries >>= 1; | 1146 | pool_entries >>= 1; |
1147 | 1147 | ||
1148 | *bvp = mempool_create_slab_pool(pool_entries, bp->slab); | 1148 | *bvp = mempool_create_slab_pool(pool_entries, bp->slab); |