summaryrefslogtreecommitdiffstats
path: root/sys/geom/stripe
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2009-09-04 19:20:46 +0000
committermav <mav@FreeBSD.org>2009-09-04 19:20:46 +0000
commitff8e63fcdffd6e854375e7fc8a7075e3a2ffea00 (patch)
tree08d482dd4f8060ebb69079fe2343a3d4b19edc19 /sys/geom/stripe
parent319f7fbbc6799a227d221328cd92f41021b6597d (diff)
downloadFreeBSD-src-ff8e63fcdffd6e854375e7fc8a7075e3a2ffea00.zip
FreeBSD-src-ff8e63fcdffd6e854375e7fc8a7075e3a2ffea00.tar.gz
Remove artificial MAX_IO_SIZE constant, equal to DFLTPHYS * 2. Use MAXPHYS
instead. It is NULL change for GENERIC kernel, but allows 'fast' mode to work on systems with increased MAXPHYS.
Diffstat (limited to 'sys/geom/stripe')
-rw-r--r--sys/geom/stripe/g_stripe.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/sys/geom/stripe/g_stripe.c b/sys/geom/stripe/g_stripe.c
index 88b0cad..17e258c 100644
--- a/sys/geom/stripe/g_stripe.c
+++ b/sys/geom/stripe/g_stripe.c
@@ -41,7 +41,6 @@ __FBSDID("$FreeBSD$");
#include <geom/stripe/g_stripe.h>
-#define MAX_IO_SIZE (DFLTPHYS * 2)
static MALLOC_DEFINE(M_STRIPE, "stripe_data", "GEOM_STRIPE Data");
static uma_zone_t g_stripe_zone;
@@ -87,7 +86,7 @@ g_sysctl_stripe_fast(SYSCTL_HANDLER_ARGS)
}
SYSCTL_PROC(_kern_geom_stripe, OID_AUTO, fast, CTLTYPE_INT | CTLFLAG_RW,
NULL, 0, g_sysctl_stripe_fast, "I", "Fast, but memory-consuming, mode");
-static u_int g_stripe_maxmem = MAX_IO_SIZE * 100;
+static u_int g_stripe_maxmem = MAXPHYS * 100;
TUNABLE_INT("kern.geom.stripe.maxmem", &g_stripe_maxmem);
SYSCTL_UINT(_kern_geom_stripe, OID_AUTO, maxmem, CTLFLAG_RD, &g_stripe_maxmem,
0, "Maximum memory that can be allocated in \"fast\" mode (in bytes)");
@@ -125,10 +124,10 @@ static void
g_stripe_init(struct g_class *mp __unused)
{
- g_stripe_zone = uma_zcreate("g_stripe_zone", MAX_IO_SIZE, NULL, NULL,
+ g_stripe_zone = uma_zcreate("g_stripe_zone", MAXPHYS, NULL, NULL,
NULL, NULL, 0, 0);
- g_stripe_maxmem -= g_stripe_maxmem % MAX_IO_SIZE;
- uma_zone_set_max(g_stripe_zone, g_stripe_maxmem / MAX_IO_SIZE);
+ g_stripe_maxmem -= g_stripe_maxmem % MAXPHYS;
+ uma_zone_set_max(g_stripe_zone, g_stripe_maxmem / MAXPHYS);
}
static void
@@ -613,14 +612,14 @@ g_stripe_start(struct bio *bp)
* Do use "fast" mode when:
* 1. "Fast" mode is ON.
* and
- * 2. Request size is less than or equal to MAX_IO_SIZE (128kB),
+ * 2. Request size is less than or equal to MAXPHYS,
* which should always be true.
* and
* 3. Request size is bigger than stripesize * ndisks. If it isn't,
* there will be no need to send more than one I/O request to
* a provider, so there is nothing to optmize.
*/
- if (g_stripe_fast && bp->bio_length <= MAX_IO_SIZE &&
+ if (g_stripe_fast && bp->bio_length <= MAXPHYS &&
bp->bio_length >= stripesize * sc->sc_ndisks) {
fast = 1;
}
OpenPOWER on IntegriCloud