aboutsummaryrefslogtreecommitdiff
path: root/sys/vm/vm_page.c
diff options
context:
space:
mode:
authorAlan Cox <alc@FreeBSD.org>2002-11-03 22:20:42 +0000
committerAlan Cox <alc@FreeBSD.org>2002-11-03 22:20:42 +0000
commitc71f01affeb35e2f996feee126157d38beb6506d (patch)
tree06b1b4bdda12ae0dcd12c21275489ace73123491 /sys/vm/vm_page.c
parent26bfc47f8680e6dd3ac22e725c12eb5c52786813 (diff)
downloadsrc-c71f01affeb35e2f996feee126157d38beb6506d.tar.gz
src-c71f01affeb35e2f996feee126157d38beb6506d.zip
- Remove the memory allocation for the object/offset hash table
because it's no longer used. (See revision 1.215.) - Fix a harmless bug: the number of vm_page structures allocated wasn't properly adjusted when uma_bootstrap() was introduced. Consequently, we were allocating 30 unused vm_page structures. - Wrap a long line.
Notes
Notes: svn path=/head/; revision=106387
Diffstat (limited to 'sys/vm/vm_page.c')
-rw-r--r--sys/vm/vm_page.c47
1 files changed, 2 insertions, 45 deletions
diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c
index 46b755647a22..4924e2b552ef 100644
--- a/sys/vm/vm_page.c
+++ b/sys/vm/vm_page.c
@@ -125,9 +125,6 @@
* Associated with page of user-allocatable memory is a
* page structure.
*/
-static struct vm_page **vm_page_buckets; /* Array of buckets */
-static int vm_page_bucket_count; /* How big is array? */
-static int vm_page_hash_mask; /* Mask for hash function */
struct mtx vm_page_queue_mtx;
struct mtx vm_page_queue_free_mtx;
@@ -166,7 +163,6 @@ vm_offset_t
vm_page_startup(vm_offset_t starta, vm_offset_t enda, vm_offset_t vaddr)
{
vm_offset_t mapped;
- struct vm_page **bucket;
vm_size_t npages, page_range;
vm_offset_t new_end;
int i;
@@ -219,7 +215,8 @@ 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
+ * Allocate memory for use when boot strapping the kernel memory
+ * allocator.
*/
bootpages = UMA_BOOT_PAGES * UMA_SLAB_SIZE;
new_end = end - bootpages;
@@ -229,46 +226,6 @@ vm_page_startup(vm_offset_t starta, vm_offset_t enda, vm_offset_t vaddr)
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
- * the next power of 2 greater than the number of physical pages in
- * the system.
- *
- * We make the hash table approximately 2x the number of pages to
- * reduce the chain length. This is about the same size using the
- * singly-linked list as the 1x hash table we were using before
- * using TAILQ but the chain length will be smaller.
- *
- * Note: This computation can be tweaked if desired.
- */
- if (vm_page_bucket_count == 0) {
- vm_page_bucket_count = 1;
- while (vm_page_bucket_count < atop(total))
- vm_page_bucket_count <<= 1;
- }
- vm_page_bucket_count <<= 1;
- vm_page_hash_mask = vm_page_bucket_count - 1;
-
- /*
- * Validate these addresses.
- */
- new_end = end - vm_page_bucket_count * sizeof(struct vm_page *);
- 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);
-
- vm_page_buckets = (struct vm_page **)mapped;
- bucket = vm_page_buckets;
- for (i = 0; i < vm_page_bucket_count; i++) {
- *bucket = NULL;
- bucket++;
- }
-
/*
* Compute the number of pages of memory that will be available for
* use (taking into account the overhead of a page structure per