Deleted Added
sdiff udiff text old ( 156420 ) new ( 157908 )
full compact
1/*-
2 * Copyright (c) 1991 Regents of the University of California.
3 * All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * The Mach Operating System project at Carnegie-Mellon University.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 83 unchanged lines hidden (view full) ---

92 * and free queues are actually arrays already.
93 */
94
95/*
96 * Resident memory management module.
97 */
98
99#include <sys/cdefs.h>
100__FBSDID("$FreeBSD: head/sys/vm/vm_page.c 156420 2006-03-08 06:31:46Z imp $");
101
102#include <sys/param.h>
103#include <sys/systm.h>
104#include <sys/lock.h>
105#include <sys/kernel.h>
106#include <sys/malloc.h>
107#include <sys/mutex.h>
108#include <sys/proc.h>

--- 7 unchanged lines hidden (view full) ---

116#include <vm/vm_object.h>
117#include <vm/vm_page.h>
118#include <vm/vm_pageout.h>
119#include <vm/vm_pager.h>
120#include <vm/vm_extern.h>
121#include <vm/uma.h>
122#include <vm/uma_int.h>
123
124/*
125 * Associated with page of user-allocatable memory is a
126 * page structure.
127 */
128
129struct mtx vm_page_queue_mtx;
130struct mtx vm_page_queue_free_mtx;
131

--- 95 unchanged lines hidden (view full) ---

227 */
228 new_end = end - (boot_pages * UMA_SLAB_SIZE);
229 new_end = trunc_page(new_end);
230 mapped = pmap_map(&vaddr, new_end, end,
231 VM_PROT_READ | VM_PROT_WRITE);
232 bzero((void *)mapped, end - new_end);
233 uma_startup((void *)mapped, boot_pages);
234
235 /*
236 * Compute the number of pages of memory that will be available for
237 * use (taking into account the overhead of a page structure per
238 * page).
239 */
240 first_page = phys_avail[0] / PAGE_SIZE;
241 page_range = phys_avail[(nblocks - 1) * 2 + 1] / PAGE_SIZE - first_page;
242 npages = (total - (page_range * sizeof(struct vm_page)) -
243 (end - new_end)) / PAGE_SIZE;

--- 1520 unchanged lines hidden ---