Deleted Added
full compact
vm_fault.c (17294) vm_fault.c (17312)
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.53 1996/07/02 02:07:59 dyson Exp $
69 * $Id: vm_fault.c,v 1.54 1996/07/27 03:23:52 dyson Exp $
70 */
71
72/*
73 * Page fault handling module.
74 */
75
76#include <sys/param.h>
77#include <sys/systm.h>

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

288 vm_page_activate(m);
289 UNLOCK_AND_DEALLOCATE;
290 VM_WAIT;
291 goto RetryFault;
292 }
293
294 m->flags |= PG_BUSY;
295
70 */
71
72/*
73 * Page fault handling module.
74 */
75
76#include <sys/param.h>
77#include <sys/systm.h>

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

288 vm_page_activate(m);
289 UNLOCK_AND_DEALLOCATE;
290 VM_WAIT;
291 goto RetryFault;
292 }
293
294 m->flags |= PG_BUSY;
295
296 if (((m->valid & VM_PAGE_BITS_ALL) != VM_PAGE_BITS_ALL) &&
296 if (m->valid &&
297 ((m->valid & VM_PAGE_BITS_ALL) != VM_PAGE_BITS_ALL) &&
297 m->object != kernel_object && m->object != kmem_object) {
298 goto readrest;
299 }
300 break;
301 }
302 if (((object->type != OBJT_DEFAULT) && (!change_wiring || wired))
303 || (object == first_object)) {
304

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

391 UNLOCK_MAP;
392
393 rv = faultcount ?
394 vm_pager_get_pages(object, marray, faultcount,
395 reqpage) : VM_PAGER_FAIL;
396
397 if (rv == VM_PAGER_OK) {
398 /*
298 m->object != kernel_object && m->object != kmem_object) {
299 goto readrest;
300 }
301 break;
302 }
303 if (((object->type != OBJT_DEFAULT) && (!change_wiring || wired))
304 || (object == first_object)) {
305

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

392 UNLOCK_MAP;
393
394 rv = faultcount ?
395 vm_pager_get_pages(object, marray, faultcount,
396 reqpage) : VM_PAGER_FAIL;
397
398 if (rv == VM_PAGER_OK) {
399 /*
400 * Found the page. Leave it busy while we play
401 * with it.
402 */
403
404 /*
399 * Relookup in case pager changed page. Pager
400 * is responsible for disposition of old page
401 * if moved.
402 */
405 * Relookup in case pager changed page. Pager
406 * is responsible for disposition of old page
407 * if moved.
408 */
403 if ((m->object != object) || (m->pindex != pindex) ||
404 (m->flags & PG_TABLED) == 0) {
405 m = vm_page_lookup(object, pindex);
406 if( !m) {
407 UNLOCK_AND_DEALLOCATE;
408 goto RetryFault;
409 }
409 m = vm_page_lookup(object, pindex);
410 if( !m) {
411 UNLOCK_AND_DEALLOCATE;
412 goto RetryFault;
410 }
411
412 hardfault++;
413 break;
414 }
415 /*
416 * Remove the bogus page (which does not exist at this
417 * object/offset); before doing so, we must get back

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

473 vm_object_pip_wakeup(object);
474
475 object = first_object;
476 pindex = first_pindex;
477 m = first_m;
478 }
479 first_m = NULL;
480
413 }
414
415 hardfault++;
416 break;
417 }
418 /*
419 * Remove the bogus page (which does not exist at this
420 * object/offset); before doing so, we must get back

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

476 vm_object_pip_wakeup(object);
477
478 object = first_object;
479 pindex = first_pindex;
480 m = first_m;
481 }
482 first_m = NULL;
483
481 if ((m->flags & PG_ZERO) == 0) {
482 if (vm_page_zero_count) {
483 vm_page_protect(m, VM_PROT_NONE);
484 PAGE_WAKEUP(m);
485 vm_page_free(m);
486 m = vm_page_alloc(object, pindex, VM_ALLOC_ZERO);
487 if (!m)
488 panic("vm_fault: missing zero page");
489 /*
490 * This should not be true, but just in case...
491 */
492 if ((m->flags & PG_ZERO) == 0) {
493 vm_page_zero_fill(m);
494 cnt.v_zfod++;
495 }
496 } else {
497 vm_page_zero_fill(m);
498 cnt.v_zfod++;
499 }
500 }
484 if ((m->flags & PG_ZERO) == 0)
485 vm_page_zero_fill(m);
486 cnt.v_zfod++;
501 break;
502 } else {
503 if (object != first_object) {
504 vm_object_pip_wakeup(object);
505 }
506 object = next_object;
507 object->paging_in_progress++;
508 }

--- 645 unchanged lines hidden ---
487 break;
488 } else {
489 if (object != first_object) {
490 vm_object_pip_wakeup(object);
491 }
492 object = next_object;
493 object->paging_in_progress++;
494 }

--- 645 unchanged lines hidden ---