diff options
author | Gleb Smirnoff <glebius@FreeBSD.org> | 2019-01-15 01:02:16 +0000 |
---|---|---|
committer | Gleb Smirnoff <glebius@FreeBSD.org> | 2019-01-15 01:02:16 +0000 |
commit | 756a5412798b7de1709bb1de2db5ba2a5908cba3 (patch) | |
tree | 90da29baacc3d3eccb4f10f6629ca9f3993be631 /sys/kern/vfs_bio.c | |
parent | 7c895edb6673b6cfe6ddcc024a5d2ab234bda7cc (diff) | |
download | src-756a5412798b7de1709bb1de2db5ba2a5908cba3.tar.gz src-756a5412798b7de1709bb1de2db5ba2a5908cba3.zip |
Allocate pager bufs from UMA instead of 80-ish mutex protected linked list.
o In vm_pager_bufferinit() create pbuf_zone and start accounting on how many
pbufs are we going to have set.
In various subsystems that are going to utilize pbufs create private zones
via call to pbuf_zsecond_create(). The latter calls uma_zsecond_create(),
and sets a limit on created zone. After startup preallocate pbufs according
to requirements of all pbuf zones.
Subsystems that used to have a private limit with old allocator now have
private pbuf zones: md(4), fusefs, NFS client, smbfs, VFS cluster, FFS,
swap, vnode pager.
The following subsystems use shared pbuf zone: cam(4), nvme(4), physio(9),
aio(4). They should have their private limits, but changing that is out of
scope of this commit.
o Fetch tunable value of kern.nswbuf from init_param2() and while here move
NSWBUF_MIN to opt_param.h and eliminate opt_swap.h, that was holding only
this option.
Default values aren't touched by this commit, but they probably should be
reviewed wrt to modern hardware.
This change removes a tight bottleneck from sendfile(2) operation, that
uses pbufs in vnode pager. Other pagers also would benefit from faster
allocation.
Together with: gallatin
Tested by: pho
Notes
Notes:
svn path=/head/; revision=343030
Diffstat (limited to 'sys/kern/vfs_bio.c')
-rw-r--r-- | sys/kern/vfs_bio.c | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c index 2f0f3a637f7e..3766c7d8d55f 100644 --- a/sys/kern/vfs_bio.c +++ b/sys/kern/vfs_bio.c @@ -86,7 +86,6 @@ __FBSDID("$FreeBSD$"); #include <vm/vm_extern.h> #include <vm/vm_map.h> #include <vm/swap_pager.h> -#include "opt_swap.h" static MALLOC_DEFINE(M_BIOBUF, "biobuf", "BIO buffer"); @@ -1017,10 +1016,6 @@ bd_speedup(void) mtx_unlock(&bdlock); } -#ifndef NSWBUF_MIN -#define NSWBUF_MIN 16 -#endif - #ifdef __i386__ #define TRANSIENT_DENOM 5 #else @@ -1130,19 +1125,8 @@ 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 = min(nbuf / 4, 256); - TUNABLE_INT_FETCH("kern.nswbuf", &nswbuf); - if (nswbuf < NSWBUF_MIN) - nswbuf = NSWBUF_MIN; - - /* * Reserve space for the buffer cache buffers */ - swbuf = (void *)v; - v = (caddr_t)(swbuf + nswbuf); buf = (void *)v; v = (caddr_t)(buf + nbuf); |