svn commit: r273150 - stable/10/sys/kern

Jung-uk Kim jkim at FreeBSD.org
Wed Oct 15 20:04:22 UTC 2014


Author: jkim
Date: Wed Oct 15 20:04:21 2014
New Revision: 273150
URL: https://svnweb.freebsd.org/changeset/base/273150

Log:
  MFC:	r272718
  
  Make kern.nswbuf tunable from loader.

Modified:
  stable/10/sys/kern/vfs_bio.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/kern/vfs_bio.c
==============================================================================
--- stable/10/sys/kern/vfs_bio.c	Wed Oct 15 19:59:43 2014	(r273149)
+++ stable/10/sys/kern/vfs_bio.c	Wed Oct 15 20:04:21 2014	(r273150)
@@ -636,6 +636,10 @@ bd_speedup(void)
 	mtx_unlock(&bdlock);
 }
 
+#ifndef NSWBUF_MIN
+#define	NSWBUF_MIN	16
+#endif
+
 #ifdef __i386__
 #define	TRANSIENT_DENOM	5
 #else
@@ -747,11 +751,10 @@ kern_vfs_bio_buffer_alloc(caddr_t v, lon
 	 * swbufs are used as temporary holders for I/O, such as paging I/O.
 	 * We have no less then 16 and no more then 256.
 	 */
-	nswbuf = max(min(nbuf/4, 256), 16);
-#ifdef NSWBUF_MIN
+	nswbuf = min(nbuf / 4, 256);
+	TUNABLE_INT_FETCH("kern.nswbuf", &nswbuf);
 	if (nswbuf < NSWBUF_MIN)
 		nswbuf = NSWBUF_MIN;
-#endif
 
 	/*
 	 * Reserve space for the buffer cache buffers


More information about the svn-src-stable-10 mailing list