summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>2005-10-08 21:03:54 +0000
committerdes <des@FreeBSD.org>2005-10-08 21:03:54 +0000
commitc66d4a275dc70f30fdb0f3697319a06b3d5ef604 (patch)
treed2daa61bd2acc81c850762097940323e59624571 /sys
parent5374999d013200def723741dd18b40500a1c0f37 (diff)
downloadFreeBSD-src-c66d4a275dc70f30fdb0f3697319a06b3d5ef604.zip
FreeBSD-src-c66d4a275dc70f30fdb0f3697319a06b3d5ef604.tar.gz
As alc pointed out to me, vm_page.c 1.305 was incomplete: uma_startup()
still uses the constant UMA_BOOT_PAGES. Change it to accept boot_pages as an additional argument. MFC after: 2 weeks
Diffstat (limited to 'sys')
-rw-r--r--sys/vm/uma.h4
-rw-r--r--sys/vm/uma_core.c8
-rw-r--r--sys/vm/vm_page.c4
3 files changed, 8 insertions, 8 deletions
diff --git a/sys/vm/uma.h b/sys/vm/uma.h
index 52bbe2c..2181ec7 100644
--- a/sys/vm/uma.h
+++ b/sys/vm/uma.h
@@ -350,11 +350,11 @@ typedef void (*uma_free)(void *item, int size, u_int8_t pflag);
* Discussion:
* This memory is used for zones which allocate things before the
* backend page supplier can give us pages. It should be
- * UMA_SLAB_SIZE * UMA_BOOT_PAGES bytes. (see uma_int.h)
+ * UMA_SLAB_SIZE * boot_pages bytes. (see uma_int.h)
*
*/
-void uma_startup(void *bootmem);
+void uma_startup(void *bootmem, int boot_pages);
/*
* Finishes starting up the allocator. This should
diff --git a/sys/vm/uma_core.c b/sys/vm/uma_core.c
index 49d1e3c..a15c453 100644
--- a/sys/vm/uma_core.c
+++ b/sys/vm/uma_core.c
@@ -324,7 +324,7 @@ bucket_alloc(int entries, int bflags)
/*
* This is to stop us from allocating per cpu buckets while we're
- * running out of UMA_BOOT_PAGES. Otherwise, we would exhaust the
+ * running out of vm.boot_pages. Otherwise, we would exhaust the
* boot pages. This also prevents us from allocating buckets in
* low memory situations.
*/
@@ -921,7 +921,7 @@ startup_alloc(uma_zone_t zone, int bytes, u_int8_t *pflag, int wait)
}
mtx_unlock(&uma_boot_pages_mtx);
if (booted == 0)
- panic("UMA: Increase UMA_BOOT_PAGES");
+ panic("UMA: Increase vm.boot_pages");
/*
* Now that we've booted reset these users to their real allocator.
*/
@@ -1499,7 +1499,7 @@ zone_foreach(void (*zfunc)(uma_zone_t))
/* Public functions */
/* See uma.h */
void
-uma_startup(void *bootmem)
+uma_startup(void *bootmem, int boot_pages)
{
struct uma_zctor_args args;
uma_slab_t slab;
@@ -1599,7 +1599,7 @@ uma_startup(void *bootmem)
#ifdef UMA_DEBUG
printf("Filling boot free list.\n");
#endif
- for (i = 0; i < UMA_BOOT_PAGES; i++) {
+ for (i = 0; i < boot_pages; i++) {
slab = (uma_slab_t)((u_int8_t *)bootmem + (i * UMA_SLAB_SIZE));
slab->us_data = (u_int8_t *)slab;
slab->us_flags = UMA_SLAB_BOOT;
diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c
index 6dd51b5..98ec1ef 100644
--- a/sys/vm/vm_page.c
+++ b/sys/vm/vm_page.c
@@ -229,8 +229,8 @@ vm_page_startup(vm_offset_t vaddr)
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);
+ bzero((void *)mapped, end - new_end);
+ uma_startup((void *)mapped, boot_pages);
/*
* Compute the number of pages of memory that will be available for
OpenPOWER on IntegriCloud