Deleted Added
full compact
vm_page.c (156420) vm_page.c (157908)
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>
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 $");
100__FBSDID("$FreeBSD: head/sys/vm/vm_page.c 157908 2006-04-21 04:24:50Z peter $");
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
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#include <machine/md_var.h>
125
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
126/*
127 * Associated with page of user-allocatable memory is a
128 * page structure.
129 */
130
131struct mtx vm_page_queue_mtx;
132struct mtx vm_page_queue_free_mtx;
133

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

229 */
230 new_end = end - (boot_pages * UMA_SLAB_SIZE);
231 new_end = trunc_page(new_end);
232 mapped = pmap_map(&vaddr, new_end, end,
233 VM_PROT_READ | VM_PROT_WRITE);
234 bzero((void *)mapped, end - new_end);
235 uma_startup((void *)mapped, boot_pages);
236
237#if defined(__amd64__) || defined(__i386__)
235 /*
238 /*
239 * Allocate a bitmap to indicate that a random physical page
240 * needs to be included in a minidump.
241 *
242 * The amd64 port needs this to indicate which direct map pages
243 * need to be dumped, via calls to dump_add_page()/dump_drop_page().
244 *
245 * However, i386 still needs this workspace internally within the
246 * minidump code. In theory, they are not needed on i386, but are
247 * included should the sf_buf code decide to use them.
248 */
249 page_range = phys_avail[(nblocks - 1) * 2 + 1] / PAGE_SIZE;
250 vm_page_dump_size = round_page(roundup2(page_range, NBBY) / NBBY);
251 new_end -= vm_page_dump_size;
252 vm_page_dump = (void *)(uintptr_t)pmap_map(&vaddr, new_end,
253 new_end + vm_page_dump_size, VM_PROT_READ | VM_PROT_WRITE);
254 bzero((void *)vm_page_dump, vm_page_dump_size);
255#endif
256 /*
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 ---
257 * Compute the number of pages of memory that will be available for
258 * use (taking into account the overhead of a page structure per
259 * page).
260 */
261 first_page = phys_avail[0] / PAGE_SIZE;
262 page_range = phys_avail[(nblocks - 1) * 2 + 1] / PAGE_SIZE - first_page;
263 npages = (total - (page_range * sizeof(struct vm_page)) -
264 (end - new_end)) / PAGE_SIZE;

--- 1520 unchanged lines hidden ---