Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 27 Mar 2013 10:56:15 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r248790 - head/sys/kern
Message-ID:  <201303271056.r2RAuFl7066361@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Wed Mar 27 10:56:15 2013
New Revision: 248790
URL: http://svnweb.freebsd.org/changeset/base/248790

Log:
  On i386, double the default size of the bio transient map.  With the
  maxbcache size fixed, the auto-tuned transient map is too small for
  real-world load on i386.
  
  Tested by:	David Wolfskill
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/sys/kern/vfs_bio.c

Modified: head/sys/kern/vfs_bio.c
==============================================================================
--- head/sys/kern/vfs_bio.c	Wed Mar 27 10:52:18 2013	(r248789)
+++ head/sys/kern/vfs_bio.c	Wed Mar 27 10:56:15 2013	(r248790)
@@ -520,6 +520,12 @@ bd_speedup(void)
 	mtx_unlock(&bdlock);
 }
 
+#ifdef __i386__
+#define	TRANSIENT_DENOM	5
+#else
+#define	TRANSIENT_DENOM 10
+#endif
+
 /*
  * Calculating buffer cache scaling values and reserve space for buffer
  * headers.  This is called during low level kernel initialization and
@@ -579,8 +585,8 @@ kern_vfs_bio_buffer_alloc(caddr_t v, lon
 	 * to the amount of the buffer mapped for typical UFS load.
 	 *
 	 * Clip the buffer map to reserve space for the transient
-	 * BIOs, if its extent is bigger than 90% of the maximum
-	 * buffer map extent on the platform.
+	 * BIOs, if its extent is bigger than 90% (80% on i386) of the
+	 * maximum buffer map extent on the platform.
 	 *
 	 * The fall-back to the maxbuf in case of maxbcache unset,
 	 * allows to not trim the buffer KVA for the architectures
@@ -589,7 +595,8 @@ kern_vfs_bio_buffer_alloc(caddr_t v, lon
 	if (bio_transient_maxcnt == 0 && unmapped_buf_allowed) {
 		maxbuf_sz = maxbcache != 0 ? maxbcache : maxbuf * BKVASIZE;
 		buf_sz = (long)nbuf * BKVASIZE;
-		if (buf_sz < maxbuf_sz / 10 * 9) {
+		if (buf_sz < maxbuf_sz / TRANSIENT_DENOM *
+		    (TRANSIENT_DENOM - 1)) {
 			/*
 			 * There is more KVA than memory.  Do not
 			 * adjust buffer map size, and assign the rest
@@ -599,10 +606,10 @@ kern_vfs_bio_buffer_alloc(caddr_t v, lon
 		} else {
 			/*
 			 * Buffer map spans all KVA we could afford on
-			 * this platform.  Give 10% of the buffer map
-			 * to the transient bio map.
+			 * this platform.  Give 10% (20% on i386) of
+			 * the buffer map to the transient bio map.
 			 */
- 			biotmap_sz = buf_sz / 10;
+			biotmap_sz = buf_sz / TRANSIENT_DENOM;
 			buf_sz -= biotmap_sz;
 		}
 		if (biotmap_sz / INT_MAX > MAXPHYS)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201303271056.r2RAuFl7066361>