diff options
author | NeilBrown <neilb@suse.de> | 2010-10-26 18:31:13 +1100 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2010-10-28 17:36:15 +1100 |
commit | a167f663243662aa9153c01086580a11cde9ffdc (patch) | |
tree | 886e64787421bbf17a1eab7853d67258b598f050 /drivers/md/raid10.c | |
parent | 2b193363ef68667ad717a6723165e0dccf99470f (diff) |
md: use separate bio pool for each md device.
bio_clone and bio_alloc allocate from a common bio pool.
If an md device is stacked with other devices that use this pool, or under
something like swap which uses the pool, then the multiple calls on
the pool can cause deadlocks.
So allocate a local bio pool for each md array and use that rather
than the common pool.
This pool is used both for regular IO and metadata updates.
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md/raid10.c')
-rw-r--r-- | drivers/md/raid10.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c index d54122b9927..c67aa54694a 100644 --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c @@ -889,7 +889,7 @@ static int make_request(mddev_t *mddev, struct bio * bio) } mirror = conf->mirrors + disk; - read_bio = bio_clone(bio, GFP_NOIO); + read_bio = bio_clone_mddev(bio, GFP_NOIO, mddev); r10_bio->devs[slot].bio = read_bio; @@ -958,7 +958,7 @@ static int make_request(mddev_t *mddev, struct bio * bio) if (!r10_bio->devs[i].bio) continue; - mbio = bio_clone(bio, GFP_NOIO); + mbio = bio_clone_mddev(bio, GFP_NOIO, mddev); r10_bio->devs[i].bio = mbio; mbio->bi_sector = r10_bio->devs[i].addr+ @@ -1746,7 +1746,8 @@ static void raid10d(mddev_t *mddev) mdname(mddev), bdevname(rdev->bdev,b), (unsigned long long)r10_bio->sector); - bio = bio_clone(r10_bio->master_bio, GFP_NOIO); + bio = bio_clone_mddev(r10_bio->master_bio, + GFP_NOIO, mddev); r10_bio->devs[r10_bio->read_slot].bio = bio; bio->bi_sector = r10_bio->devs[r10_bio->read_slot].addr + rdev->data_offset; |