aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/raid1.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2010-10-26 03:31:13 -0400
committerNeilBrown <neilb@suse.de>2010-10-28 02:36:15 -0400
commita167f663243662aa9153c01086580a11cde9ffdc (patch)
tree886e64787421bbf17a1eab7853d67258b598f050 /drivers/md/raid1.c
parent2b193363ef68667ad717a6723165e0dccf99470f (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/raid1.c')
-rw-r--r--drivers/md/raid1.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index 08c66afea494..54f60c9e5f85 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -861,7 +861,7 @@ static int make_request(mddev_t *mddev, struct bio * bio)
861 } 861 }
862 r1_bio->read_disk = rdisk; 862 r1_bio->read_disk = rdisk;
863 863
864 read_bio = bio_clone(bio, GFP_NOIO); 864 read_bio = bio_clone_mddev(bio, GFP_NOIO, mddev);
865 865
866 r1_bio->bios[rdisk] = read_bio; 866 r1_bio->bios[rdisk] = read_bio;
867 867
@@ -950,7 +950,7 @@ static int make_request(mddev_t *mddev, struct bio * bio)
950 if (!r1_bio->bios[i]) 950 if (!r1_bio->bios[i])
951 continue; 951 continue;
952 952
953 mbio = bio_clone(bio, GFP_NOIO); 953 mbio = bio_clone_mddev(bio, GFP_NOIO, mddev);
954 r1_bio->bios[i] = mbio; 954 r1_bio->bios[i] = mbio;
955 955
956 mbio->bi_sector = r1_bio->sector + conf->mirrors[i].rdev->data_offset; 956 mbio->bi_sector = r1_bio->sector + conf->mirrors[i].rdev->data_offset;
@@ -1640,7 +1640,8 @@ static void raid1d(mddev_t *mddev)
1640 mddev->ro ? IO_BLOCKED : NULL; 1640 mddev->ro ? IO_BLOCKED : NULL;
1641 r1_bio->read_disk = disk; 1641 r1_bio->read_disk = disk;
1642 bio_put(bio); 1642 bio_put(bio);
1643 bio = bio_clone(r1_bio->master_bio, GFP_NOIO); 1643 bio = bio_clone_mddev(r1_bio->master_bio,
1644 GFP_NOIO, mddev);
1644 r1_bio->bios[r1_bio->read_disk] = bio; 1645 r1_bio->bios[r1_bio->read_disk] = bio;
1645 rdev = conf->mirrors[disk].rdev; 1646 rdev = conf->mirrors[disk].rdev;
1646 if (printk_ratelimit()) 1647 if (printk_ratelimit())