Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/tls-maxphys]: src/sys/dev/raidframe Add a minphys routine for raidframe.
details: https://anonhg.NetBSD.org/src/rev/88e2e7e22c79
branches: tls-maxphys
changeset: 852932:88e2e7e22c79
user: tls <tls%NetBSD.org@localhost>
date: Wed Oct 17 01:36:13 2012 +0000
description:
Add a minphys routine for raidframe.
For now, we will address the problem of someone adding, at runtime with
a filesystem mounted, a drive to an existing RAID set, that drive being
on a different controller or bus such that it has a smaller maximum
transfer size than the smallest such size of any component previously
in the set, by clamping RAIDframe's reported maximum transfer size at
the old MAXPHYS value multiplied by the number of data disks in the
set.
In the future, we could either implement transfer-splitting to
the device specific maxphys in a generic way for all disks (Manuel's
proposal, and probably the best solution) or simply forbid adding
new components to RAID sets while running if those new components
have a smaller maxphys than that of any component already in the set
(my proposal; less flexible but a lot less code to write).
Anyway, now you should be able to see your 5 disk RAID5 set do
256k transfers through the filesystem -- 64k per component
instead of 64K total. A win!
diffstat:
sys/dev/raidframe/rf_netbsdkintf.c | 33 ++++++++++++++++++++++++++++-----
1 files changed, 28 insertions(+), 5 deletions(-)
diffs (72 lines):
diff -r f7d71f411b4a -r 88e2e7e22c79 sys/dev/raidframe/rf_netbsdkintf.c
--- a/sys/dev/raidframe/rf_netbsdkintf.c Sun Oct 14 14:33:32 2012 +0000
+++ b/sys/dev/raidframe/rf_netbsdkintf.c Wed Oct 17 01:36:13 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rf_netbsdkintf.c,v 1.298 2012/08/09 23:53:25 buhrow Exp $ */
+/* $NetBSD: rf_netbsdkintf.c,v 1.298.2.1 2012/10/17 01:36:13 tls Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998, 2008-2011 The NetBSD Foundation, Inc.
@@ -101,7 +101,7 @@
***********************************************************/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.298 2012/08/09 23:53:25 buhrow Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.298.2.1 2012/10/17 01:36:13 tls Exp $");
#ifdef _KERNEL_OPT
#include "opt_compat_netbsd.h"
@@ -216,7 +216,9 @@
nostop, notty, nopoll, nommap, nokqfilter, D_DISK
};
-static struct dkdriver rf_dkdriver = { raidstrategy, minphys };
+static void raidminphys(struct buf *);
+
+static struct dkdriver rf_dkdriver = { raidstrategy, raidminphys };
/* XXX Not sure if the following should be replacing the raidPtrs above,
or if it should be used in conjunction with that...
@@ -925,7 +927,7 @@
if ((rs->sc_flags & RAIDF_INITED) == 0)
return (ENXIO);
- return (physio(raidstrategy, NULL, dev, B_READ, minphys, uio));
+ return (physio(raidstrategy, NULL, dev, B_READ, raidminphys, uio));
}
/* ARGSUSED */
@@ -942,7 +944,7 @@
if ((rs->sc_flags & RAIDF_INITED) == 0)
return (ENXIO);
- return (physio(raidstrategy, NULL, dev, B_WRITE, minphys, uio));
+ return (physio(raidstrategy, NULL, dev, B_WRITE, raidminphys, uio));
}
@@ -3963,3 +3965,24 @@
}
return error;
}
+
+static void
+raidminphys(struct buf *bp)
+{
+ dev_t dev;
+ int unit;
+ struct raid_softc *rs;
+ RF_Raid_t *raidPtr;
+ long xmax;
+
+ dev = bp->b_dev;
+ unit = raidunit(dev);
+ rs = &raid_softc[unit];
+ raidPtr = raidPtrs[unit];
+
+ xmax = raidPtr->Layout.numDataCol * MAXPHYS;
+
+ if (bp->b_bcount > xmax) {
+ bp->b_bcount = xmax;
+ }
+}
Home |
Main Index |
Thread Index |
Old Index