diff options
author | jkim <jkim@FreeBSD.org> | 2014-10-15 20:04:21 +0000 |
---|---|---|
committer | jkim <jkim@FreeBSD.org> | 2014-10-15 20:04:21 +0000 |
commit | d37b3c75ad839922549856f5a93907da193adb0f (patch) | |
tree | e5f3b9d302106b274792813460c894b69c550f6b | |
parent | 0b5b22505e1ef2430c5c6add5faa65f35be97ad4 (diff) | |
download | FreeBSD-src-d37b3c75ad839922549856f5a93907da193adb0f.zip FreeBSD-src-d37b3c75ad839922549856f5a93907da193adb0f.tar.gz |
MFC: r272718
Make kern.nswbuf tunable from loader.
-rw-r--r-- | sys/kern/vfs_bio.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c index 1cbc891..cc6ac46 100644 --- a/sys/kern/vfs_bio.c +++ b/sys/kern/vfs_bio.c @@ -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, long physmem_est) * 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 |