Whamcloud - gitweb
b=20533 set the default max_sectors to the raid5/6 stripe size
authorAndrew Perepechko <andrew.perepechko@oracle.com>
Tue, 12 Oct 2010 12:33:43 +0000 (16:33 +0400)
committerVitaly Fertman <vitaly.fertman@sun.com>
Mon, 18 Oct 2010 22:20:38 +0000 (02:20 +0400)
a=Kevin Van Maren
i=Jinshan Xiong
i=Atul Vidwansa

lustre/kernel_patches/patches/raid5-maxsectors-rhel5.patch [new file with mode: 0644]
lustre/kernel_patches/series/2.6-rhel5.series

diff --git a/lustre/kernel_patches/patches/raid5-maxsectors-rhel5.patch b/lustre/kernel_patches/patches/raid5-maxsectors-rhel5.patch
new file mode 100644 (file)
index 0000000..090d703
--- /dev/null
@@ -0,0 +1,23 @@
+diff -ru linux-orig/drivers/md/raid5.c linux-new/drivers/md/raid5.c
+--- linux-orig/drivers/md/raid5.c      2009-04-14 08:11:38.000000000 +1000
++++ linux-new/drivers/md/raid5.c       2009-09-20 05:02:02.000000000 +1000
+@@ -3595,10 +3595,16 @@
+       mddev->array_size =  mddev->size * (conf->previous_raid_disks -
+                                           conf->max_degraded);
++      int stripe_size = conf->chunk_size * (conf->previous_raid_disks - conf->max_degraded);
++
+       /* in order to support large I/Os */
+-      blk_queue_max_sectors(mddev->queue, conf->chunk_size * conf->previous_raid_disks >> 9);
+-      mddev->queue->max_phys_segments = conf->chunk_size * (conf->previous_raid_disks - conf->max_degraded) >> PAGE_SHIFT;
+-      mddev->queue->max_hw_segments = conf->chunk_size * conf->previous_raid_disks >> PAGE_SHIFT;;
++      blk_queue_max_sectors(mddev->queue, stripe_size >> 9);
++      /* KTVM: set default max_sectors the same as the max_hw_sectors set above */
++      mddev->queue->max_sectors = mddev->queue->max_hw_sectors;
++      printk("%s: setting max_sectors = %d, max_hw_sectors = %d\n", mdname(mddev), mddev->queue->max_sectors, mddev->queue->max_hw_sectors);
++
++      mddev->queue->max_phys_segments = stripe_size >> PAGE_SHIFT;
++      mddev->queue->max_hw_segments = stripe_size >> PAGE_SHIFT;;
+       /* raid5 device is able to do zcopy right now. */
+       mddev->queue->backing_dev_info.capabilities |= BDI_CAP_PAGE_CONSTANT_WRITE;
index 6d7639d..2d1a634 100644 (file)
@@ -15,6 +15,7 @@ raid5-large-io-rhel5.patch
 raid5-stripe-by-stripe-handling-rhel5.patch
 raid5-merge-ios-rhel5.patch
 raid5-zerocopy-rhel5.patch
+raid5-maxsectors-rhel5.patch
 md-rebuild-policy.patch
 jbd-journal-chksum-2.6.18-vanilla.patch
 quota-large-limits-rhel5.patch