diff options
author | NeilBrown <neilb@suse.de> | 2010-10-26 03:31:13 -0400 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2010-10-28 02:36:15 -0400 |
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 d54122b9927e..c67aa54694ae 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) | |||
889 | } | 889 | } |
890 | mirror = conf->mirrors + disk; | 890 | mirror = conf->mirrors + disk; |
891 | 891 | ||
892 | read_bio = bio_clone(bio, GFP_NOIO); | 892 | read_bio = bio_clone_mddev(bio, GFP_NOIO, mddev); |
893 | 893 | ||
894 | r10_bio->devs[slot].bio = read_bio; | 894 | r10_bio->devs[slot].bio = read_bio; |
895 | 895 | ||
@@ -958,7 +958,7 @@ static int make_request(mddev_t *mddev, struct bio * bio) | |||
958 | if (!r10_bio->devs[i].bio) | 958 | if (!r10_bio->devs[i].bio) |
959 | continue; | 959 | continue; |
960 | 960 | ||
961 | mbio = bio_clone(bio, GFP_NOIO); | 961 | mbio = bio_clone_mddev(bio, GFP_NOIO, mddev); |
962 | r10_bio->devs[i].bio = mbio; | 962 | r10_bio->devs[i].bio = mbio; |
963 | 963 | ||
964 | mbio->bi_sector = r10_bio->devs[i].addr+ | 964 | mbio->bi_sector = r10_bio->devs[i].addr+ |
@@ -1746,7 +1746,8 @@ static void raid10d(mddev_t *mddev) | |||
1746 | mdname(mddev), | 1746 | mdname(mddev), |
1747 | bdevname(rdev->bdev,b), | 1747 | bdevname(rdev->bdev,b), |
1748 | (unsigned long long)r10_bio->sector); | 1748 | (unsigned long long)r10_bio->sector); |
1749 | bio = bio_clone(r10_bio->master_bio, GFP_NOIO); | 1749 | bio = bio_clone_mddev(r10_bio->master_bio, |
1750 | GFP_NOIO, mddev); | ||
1750 | r10_bio->devs[r10_bio->read_slot].bio = bio; | 1751 | r10_bio->devs[r10_bio->read_slot].bio = bio; |
1751 | bio->bi_sector = r10_bio->devs[r10_bio->read_slot].addr | 1752 | bio->bi_sector = r10_bio->devs[r10_bio->read_slot].addr |
1752 | + rdev->data_offset; | 1753 | + rdev->data_offset; |