Deleted Added
full compact
vm_fault.c (16197) vm_fault.c (16268)
1/*
2 * Copyright (c) 1991, 1993
3 * The Regents of the University of California. All rights reserved.
4 * Copyright (c) 1994 John S. Dyson
5 * All rights reserved.
6 * Copyright (c) 1994 David Greenman
7 * All rights reserved.
8 *

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

61 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
62 * School of Computer Science
63 * Carnegie Mellon University
64 * Pittsburgh PA 15213-3890
65 *
66 * any improvements or extensions that they make and grant Carnegie the
67 * rights to redistribute these changes.
68 *
1/*
2 * Copyright (c) 1991, 1993
3 * The Regents of the University of California. All rights reserved.
4 * Copyright (c) 1994 John S. Dyson
5 * All rights reserved.
6 * Copyright (c) 1994 David Greenman
7 * All rights reserved.
8 *

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

61 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
62 * School of Computer Science
63 * Carnegie Mellon University
64 * Pittsburgh PA 15213-3890
65 *
66 * any improvements or extensions that they make and grant Carnegie the
67 * rights to redistribute these changes.
68 *
69 * $Id: vm_fault.c,v 1.48 1996/06/01 20:50:57 dyson Exp $
69 * $Id: vm_fault.c,v 1.49 1996/06/08 06:48:32 dyson Exp $
70 */
71
72/*
73 * Page fault handling module.
74 */
75
76#include <sys/param.h>
77#include <sys/systm.h>

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

256
257 /*
258 * See whether this page is resident
259 */
260
261 while (TRUE) {
262 m = vm_page_lookup(object, pindex);
263 if (m != NULL) {
70 */
71
72/*
73 * Page fault handling module.
74 */
75
76#include <sys/param.h>
77#include <sys/systm.h>

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

256
257 /*
258 * See whether this page is resident
259 */
260
261 while (TRUE) {
262 m = vm_page_lookup(object, pindex);
263 if (m != NULL) {
264 int queue;
264 /*
265 * If the page is being brought in, wait for it and
266 * then retry.
267 */
268 if ((m->flags & PG_BUSY) || m->busy) {
269 int s;
270
271 UNLOCK_THINGS;
272 s = splvm();
273 if (((m->flags & PG_BUSY) || m->busy)) {
274 m->flags |= PG_WANTED | PG_REFERENCED;
275 cnt.v_intrans++;
276 tsleep(m, PSWP, "vmpfw", 0);
277 }
278 splx(s);
279 vm_object_deallocate(first_object);
280 goto RetryFault;
281 }
282
265 /*
266 * If the page is being brought in, wait for it and
267 * then retry.
268 */
269 if ((m->flags & PG_BUSY) || m->busy) {
270 int s;
271
272 UNLOCK_THINGS;
273 s = splvm();
274 if (((m->flags & PG_BUSY) || m->busy)) {
275 m->flags |= PG_WANTED | PG_REFERENCED;
276 cnt.v_intrans++;
277 tsleep(m, PSWP, "vmpfw", 0);
278 }
279 splx(s);
280 vm_object_deallocate(first_object);
281 goto RetryFault;
282 }
283
284 queue = m->queue;
285 vm_page_unqueue_nowakeup(m);
286
283 /*
284 * Mark page busy for other processes, and the pagedaemon.
285 */
287 /*
288 * Mark page busy for other processes, and the pagedaemon.
289 */
286 if ((m->queue == PQ_CACHE) &&
290 if ((queue == PQ_CACHE) &&
287 (cnt.v_free_count + cnt.v_cache_count) < cnt.v_free_min) {
291 (cnt.v_free_count + cnt.v_cache_count) < cnt.v_free_min) {
292 vm_page_activate(m);
288 UNLOCK_AND_DEALLOCATE;
289 VM_WAIT;
290 goto RetryFault;
291 }
292
293 m->flags |= PG_BUSY;
293 UNLOCK_AND_DEALLOCATE;
294 VM_WAIT;
295 goto RetryFault;
296 }
297
298 m->flags |= PG_BUSY;
294 vm_page_unqueue_nowakeup(m);
295
296 if (m->valid &&
297 ((m->valid & VM_PAGE_BITS_ALL) != VM_PAGE_BITS_ALL) &&
298 m->object != kernel_object && m->object != kmem_object) {
299 goto readrest;
300 }
301 break;
302 }

--- 834 unchanged lines hidden ---
299
300 if (m->valid &&
301 ((m->valid & VM_PAGE_BITS_ALL) != VM_PAGE_BITS_ALL) &&
302 m->object != kernel_object && m->object != kmem_object) {
303 goto readrest;
304 }
305 break;
306 }

--- 834 unchanged lines hidden ---