From owner-svn-src-all@FreeBSD.ORG Fri Sep 4 19:20:47 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 87BD7106566B; Fri, 4 Sep 2009 19:20:47 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5D0438FC12; Fri, 4 Sep 2009 19:20:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n84JKlr0004087; Fri, 4 Sep 2009 19:20:47 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n84JKlab004085; Fri, 4 Sep 2009 19:20:47 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200909041920.n84JKlab004085@svn.freebsd.org> From: Alexander Motin Date: Fri, 4 Sep 2009 19:20:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196837 - head/sys/geom/stripe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Sep 2009 19:20:47 -0000 Author: mav Date: Fri Sep 4 19:20:46 2009 New Revision: 196837 URL: http://svn.freebsd.org/changeset/base/196837 Log: 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. Modified: head/sys/geom/stripe/g_stripe.c Modified: head/sys/geom/stripe/g_stripe.c ============================================================================== --- head/sys/geom/stripe/g_stripe.c Fri Sep 4 19:02:11 2009 (r196836) +++ head/sys/geom/stripe/g_stripe.c Fri Sep 4 19:20:46 2009 (r196837) @@ -41,7 +41,6 @@ __FBSDID("$FreeBSD$"); #include -#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; }