Deleted Added
full compact
vm_page.c (129145) vm_page.c (129571)
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 129145 2004-05-12 04:27:18Z alc $");
100__FBSDID("$FreeBSD: head/sys/vm/vm_page.c 129571 2004-05-22 04:53:51Z alc $");
101
102#include <sys/param.h>
103#include <sys/systm.h>
104#include <sys/lock.h>
105#include <sys/malloc.h>
106#include <sys/mutex.h>
107#include <sys/proc.h>
108#include <sys/vmmeter.h>

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

1162
1163 /*
1164 * Only bump the wire statistics if the page is not already wired,
1165 * and only unqueue the page if it is on some queue (if it is unmanaged
1166 * it is already off the queues).
1167 */
1168 s = splvm();
1169 mtx_assert(&vm_page_queue_mtx, MA_OWNED);
101
102#include <sys/param.h>
103#include <sys/systm.h>
104#include <sys/lock.h>
105#include <sys/malloc.h>
106#include <sys/mutex.h>
107#include <sys/proc.h>
108#include <sys/vmmeter.h>

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

1162
1163 /*
1164 * Only bump the wire statistics if the page is not already wired,
1165 * and only unqueue the page if it is on some queue (if it is unmanaged
1166 * it is already off the queues).
1167 */
1168 s = splvm();
1169 mtx_assert(&vm_page_queue_mtx, MA_OWNED);
1170 if (m->flags & PG_FICTITIOUS)
1171 return;
1170 if (m->wire_count == 0) {
1171 if ((m->flags & PG_UNMANAGED) == 0)
1172 vm_pageq_remove(m);
1173 atomic_add_int(&cnt.v_wire_count, 1);
1174 }
1175 m->wire_count++;
1176 KASSERT(m->wire_count != 0, ("vm_page_wire: wire_count overflow m=%p", m));
1177 splx(s);

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

1207 */
1208void
1209vm_page_unwire(vm_page_t m, int activate)
1210{
1211 int s;
1212
1213 s = splvm();
1214 mtx_assert(&vm_page_queue_mtx, MA_OWNED);
1172 if (m->wire_count == 0) {
1173 if ((m->flags & PG_UNMANAGED) == 0)
1174 vm_pageq_remove(m);
1175 atomic_add_int(&cnt.v_wire_count, 1);
1176 }
1177 m->wire_count++;
1178 KASSERT(m->wire_count != 0, ("vm_page_wire: wire_count overflow m=%p", m));
1179 splx(s);

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

1209 */
1210void
1211vm_page_unwire(vm_page_t m, int activate)
1212{
1213 int s;
1214
1215 s = splvm();
1216 mtx_assert(&vm_page_queue_mtx, MA_OWNED);
1217 if (m->flags & PG_FICTITIOUS)
1218 return;
1215 if (m->wire_count > 0) {
1216 m->wire_count--;
1217 if (m->wire_count == 0) {
1218 atomic_subtract_int(&cnt.v_wire_count, 1);
1219 if (m->flags & PG_UNMANAGED) {
1220 ;
1221 } else if (activate)
1222 vm_pageq_enqueue(PQ_ACTIVE, m);

--- 568 unchanged lines hidden ---
1219 if (m->wire_count > 0) {
1220 m->wire_count--;
1221 if (m->wire_count == 0) {
1222 atomic_subtract_int(&cnt.v_wire_count, 1);
1223 if (m->flags & PG_UNMANAGED) {
1224 ;
1225 } else if (activate)
1226 vm_pageq_enqueue(PQ_ACTIVE, m);

--- 568 unchanged lines hidden ---