summaryrefslogtreecommitdiffstats
path: root/sys/vm/vm_page.c
diff options
context:
space:
mode:
authorjeff <jeff@FreeBSD.org>2002-03-19 09:11:49 +0000
committerjeff <jeff@FreeBSD.org>2002-03-19 09:11:49 +0000
commit2923687da3c046deea227e675d5af075b9fa52d4 (patch)
tree9added529dcba41e3e9f6e15e334a8a06d6cb0f2 /sys/vm/vm_page.c
parentd95a4801fc26e963b0da94ad73f00ce63c5ed657 (diff)
downloadFreeBSD-src-2923687da3c046deea227e675d5af075b9fa52d4.zip
FreeBSD-src-2923687da3c046deea227e675d5af075b9fa52d4.tar.gz
This is the first part of the new kernel memory allocator. This replaces
malloc(9) and vm_zone with a slab like allocator. Reviewed by: arch@
Diffstat (limited to 'sys/vm/vm_page.c')
-rw-r--r--sys/vm/vm_page.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c
index 3022b73..706929a 100644
--- a/sys/vm/vm_page.c
+++ b/sys/vm/vm_page.c
@@ -118,6 +118,8 @@
#include <vm/vm_pageout.h>
#include <vm/vm_pager.h>
#include <vm/vm_extern.h>
+#include <vm/uma.h>
+#include <vm/uma_int.h>
/*
* Associated with page of user-allocatable memory is a
@@ -176,6 +178,7 @@ vm_page_startup(vm_offset_t starta, vm_offset_t enda, vm_offset_t vaddr)
vm_offset_t biggestone, biggestsize;
vm_offset_t total;
+ vm_size_t bootpages;
total = 0;
biggestsize = 0;
@@ -208,6 +211,19 @@ vm_page_startup(vm_offset_t starta, vm_offset_t enda, vm_offset_t vaddr)
vm_pageq_init();
/*
+ * Allocate memory for use when boot strapping the kernel memory allocator
+ */
+ bootpages = UMA_BOOT_PAGES * UMA_SLAB_SIZE;
+ new_end = end - bootpages;
+ new_end = trunc_page(new_end);
+ mapped = pmap_map(&vaddr, new_end, end,
+ VM_PROT_READ | VM_PROT_WRITE);
+ bzero((caddr_t) mapped, end - new_end);
+ uma_startup((caddr_t)mapped);
+
+ end = new_end;
+
+ /*
* Allocate (and initialize) the hash table buckets.
*
* The number of buckets MUST BE a power of 2, and the actual value is
OpenPOWER on IntegriCloud