Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 7 Oct 2014 20:13:47 +0000 (UTC)
From:      Jung-uk Kim <jkim@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r272718 - head/sys/kern
Message-ID:  <201410072013.s97KDltI091061@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jkim
Date: Tue Oct  7 20:13:47 2014
New Revision: 272718
URL: https://svnweb.freebsd.org/changeset/base/272718

Log:
  Make kern.nswbuf tunable from loader.
  
  MFC after:	1 week

Modified:
  head/sys/kern/vfs_bio.c

Modified: head/sys/kern/vfs_bio.c
==============================================================================
--- head/sys/kern/vfs_bio.c	Tue Oct  7 19:08:02 2014	(r272717)
+++ head/sys/kern/vfs_bio.c	Tue Oct  7 20:13:47 2014	(r272718)
@@ -667,6 +667,10 @@ bd_speedup(void)
 	mtx_unlock(&bdlock);
 }
 
+#ifndef NSWBUF_MIN
+#define	NSWBUF_MIN	16
+#endif
+
 #ifdef __i386__
 #define	TRANSIENT_DENOM	5
 #else
@@ -778,11 +782,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



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