diff options
author | jeff <jeff@FreeBSD.org> | 2013-06-28 03:51:20 +0000 |
---|---|---|
committer | jeff <jeff@FreeBSD.org> | 2013-06-28 03:51:20 +0000 |
commit | e725dd5c1ef985f6374f7a36ebdaaf10964b0131 (patch) | |
tree | 1ec9ab556a4e03f63542c71cdcc9e56ac39f7ef0 /sys/vm/vm_pager.c | |
parent | 5aabb39c86af06392b2155209b47c6511f6f8167 (diff) | |
download | FreeBSD-src-e725dd5c1ef985f6374f7a36ebdaaf10964b0131.zip FreeBSD-src-e725dd5c1ef985f6374f7a36ebdaaf10964b0131.tar.gz |
- Add a general purpose resource allocator, vmem, from NetBSD. It was
originally inspired by the Solaris vmem detailed in the proceedings
of usenix 2001. The NetBSD version was heavily refactored for bugs
and simplicity.
- Use this resource allocator to allocate the buffer and transient maps.
Buffer cache defrags are reduced by 25% when used by filesystems with
mixed block sizes. Ultimately this may permit dynamic buffer cache
sizing on low KVA machines.
Discussed with: alc, kib, attilio
Tested by: pho
Sponsored by: EMC / Isilon Storage Division
Diffstat (limited to 'sys/vm/vm_pager.c')
-rw-r--r-- | sys/vm/vm_pager.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/sys/vm/vm_pager.c b/sys/vm/vm_pager.c index 989c318..c7d038b 100644 --- a/sys/vm/vm_pager.c +++ b/sys/vm/vm_pager.c @@ -78,6 +78,7 @@ __FBSDID("$FreeBSD$"); #include <vm/vm.h> #include <vm/vm_param.h> +#include <vm/vm_kern.h> #include <vm/vm_object.h> #include <vm/vm_page.h> #include <vm/vm_pager.h> @@ -174,11 +175,10 @@ static const int npagers = sizeof(pagertab) / sizeof(pagertab[0]); * cleaning requests (NPENDINGIO == 64) * the maximum swap cluster size * (MAXPHYS == 64k) if you want to get the most efficiency. */ -vm_map_t pager_map; -static int bswneeded; -static vm_offset_t swapbkva; /* swap buffers kva */ -struct mtx pbuf_mtx; +struct mtx_padalign pbuf_mtx; static TAILQ_HEAD(swqueue, buf) bswlist; +static int bswneeded; +vm_offset_t swapbkva; /* swap buffers kva */ void vm_pager_init() @@ -215,10 +215,6 @@ vm_pager_bufferinit() cluster_pbuf_freecnt = nswbuf / 2; vnode_pbuf_freecnt = nswbuf / 2 + 1; - - swapbkva = kmem_alloc_nofault(pager_map, nswbuf * MAXPHYS); - if (!swapbkva) - panic("Not enough pager_map VM space for physical buffers"); } /* |