[Lustre-devel] mmp unplug patch

Nathan Rutman nathan_rutman at xyratex.com
Fri Jun 29 11:58:53 PDT 2012


Can anyone explain the purpose of unplug call in this patch?  The first part of the patch I get, but why do we need to drop the existing queued items?
Doesn't this simply result in more fragmented IO?

raid5-mmp-unplug-dev.patch

Force MD devices to pass SYNC reads directly to the disk
instead of handling from cache.  This is needed for MMP
on MD RAID devices, and in theory could be accepted in
the upstream kernel.  Not needed for DMU.

Index: linux-2.6.32-131.0.15.el6.x86_64/drivers/md/raid5.c
===================================================================
--- linux-2.6.32-131.0.15.el6.x86_64.orig/drivers/md/raid5.c    2011-05-10 21:38:35.000000000 +0300
+++ linux-2.6.32-131.0.15.el6.x86_64/drivers/md/raid5.c 2011-05-20 08:26:04.000000000 +0300
@@ -2177,6 +2177,8 @@ static int add_stripe_bio(struct stripe_
                bi->bi_next = *bip;
        *bip = bi;
        bi->bi_phys_segments++;
+       if (bio_rw_flagged(bi, BIO_RW_SYNCIO) && !forwrite)
+               clear_bit(R5_UPTODATE, &sh->dev[dd_idx].flags); /* force to read from disk. */
        spin_unlock_irq(&conf->device_lock);
        spin_unlock(&sh->lock);
 
@@ -4132,6 +4134,9 @@ static int make_request(mddev_t *mddev, 
                bio_endio(bi, 0);
        }
 
+       if (bio_rw_flagged(bi, BIO_RW_SYNCIO))
+               md_raid5_unplug_device(conf);
+
        return 0;
 }




More information about the lustre-devel mailing list