vm_fault.c (40700) | vm_fault.c (41322) |
---|---|
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.89 1998/10/25 17:44:58 phk Exp $ | 69 * $Id: vm_fault.c,v 1.90 1998/10/28 13:37:02 dg Exp $ |
70 */ 71 72/* 73 * Page fault handling module. 74 */ 75 76#include <sys/param.h> 77#include <sys/systm.h> --- 192 unchanged lines hidden (view full) --- 270 271 if (fs.object->flags & OBJ_DEAD) { 272 unlock_and_deallocate(&fs); 273 return (KERN_PROTECTION_FAILURE); 274 } 275 276 fs.m = vm_page_lookup(fs.object, fs.pindex); 277 if (fs.m != NULL) { | 70 */ 71 72/* 73 * Page fault handling module. 74 */ 75 76#include <sys/param.h> 77#include <sys/systm.h> --- 192 unchanged lines hidden (view full) --- 270 271 if (fs.object->flags & OBJ_DEAD) { 272 unlock_and_deallocate(&fs); 273 return (KERN_PROTECTION_FAILURE); 274 } 275 276 fs.m = vm_page_lookup(fs.object, fs.pindex); 277 if (fs.m != NULL) { |
278 int queue; | 278 int queue, s; |
279 /* 280 * If the page is being brought in, wait for it and 281 * then retry. 282 */ 283 if ((fs.m->flags & PG_BUSY) || 284 (fs.m->busy && 285 (fs.m->valid & VM_PAGE_BITS_ALL) != VM_PAGE_BITS_ALL)) { | 279 /* 280 * If the page is being brought in, wait for it and 281 * then retry. 282 */ 283 if ((fs.m->flags & PG_BUSY) || 284 (fs.m->busy && 285 (fs.m->valid & VM_PAGE_BITS_ALL) != VM_PAGE_BITS_ALL)) { |
286 int s; 287 | |
288 unlock_things(&fs); 289 s = splvm(); 290 if ((fs.m->flags & PG_BUSY) || 291 (fs.m->busy && 292 (fs.m->valid & VM_PAGE_BITS_ALL) != VM_PAGE_BITS_ALL)) { 293 vm_page_flag_set(fs.m, PG_WANTED | PG_REFERENCED); 294 cnt.v_intrans++; 295 tsleep(fs.m, PSWP, "vmpfw", 0); 296 } 297 splx(s); 298 vm_object_deallocate(fs.first_object); 299 goto RetryFault; 300 } 301 302 queue = fs.m->queue; | 286 unlock_things(&fs); 287 s = splvm(); 288 if ((fs.m->flags & PG_BUSY) || 289 (fs.m->busy && 290 (fs.m->valid & VM_PAGE_BITS_ALL) != VM_PAGE_BITS_ALL)) { 291 vm_page_flag_set(fs.m, PG_WANTED | PG_REFERENCED); 292 cnt.v_intrans++; 293 tsleep(fs.m, PSWP, "vmpfw", 0); 294 } 295 splx(s); 296 vm_object_deallocate(fs.first_object); 297 goto RetryFault; 298 } 299 300 queue = fs.m->queue; |
301 s = splvm(); |
|
303 vm_page_unqueue_nowakeup(fs.m); | 302 vm_page_unqueue_nowakeup(fs.m); |
303 splx(s); |
|
304 305 /* 306 * Mark page busy for other processes, and the pagedaemon. 307 */ 308 if (((queue - fs.m->pc) == PQ_CACHE) && 309 (cnt.v_free_count + cnt.v_cache_count) < cnt.v_free_min) { 310 vm_page_activate(fs.m); 311 unlock_and_deallocate(&fs); --- 815 unchanged lines hidden --- | 304 305 /* 306 * Mark page busy for other processes, and the pagedaemon. 307 */ 308 if (((queue - fs.m->pc) == PQ_CACHE) && 309 (cnt.v_free_count + cnt.v_cache_count) < cnt.v_free_min) { 310 vm_page_activate(fs.m); 311 unlock_and_deallocate(&fs); --- 815 unchanged lines hidden --- |