vm_glue.c (31667) | vm_glue.c (32702) |
---|---|
1/* 2 * Copyright (c) 1991, 1993 3 * The Regents of the University of California. 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 --- 45 unchanged lines hidden (view full) --- 54 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU 55 * School of Computer Science 56 * Carnegie Mellon University 57 * Pittsburgh PA 15213-3890 58 * 59 * any improvements or extensions that they make and grant Carnegie the 60 * rights to redistribute these changes. 61 * | 1/* 2 * Copyright (c) 1991, 1993 3 * The Regents of the University of California. 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 --- 45 unchanged lines hidden (view full) --- 54 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU 55 * School of Computer Science 56 * Carnegie Mellon University 57 * Pittsburgh PA 15213-3890 58 * 59 * any improvements or extensions that they make and grant Carnegie the 60 * rights to redistribute these changes. 61 * |
62 * $Id: vm_glue.c,v 1.68 1997/12/06 02:23:30 dyson Exp $ | 62 * $Id: vm_glue.c,v 1.69 1997/12/11 02:10:55 dyson Exp $ |
63 */ 64 65#include "opt_rlimit.h" 66 67#include <sys/param.h> 68#include <sys/systm.h> 69#include <sys/proc.h> 70#include <sys/resourcevar.h> --- 372 unchanged lines hidden (view full) --- 443 * out. 444 */ 445 if (((action & VM_SWAP_NORMAL) == 0) && 446 (((action & VM_SWAP_IDLE) == 0) || 447 (p->p_slptime < swap_idle_threshold2))) 448 continue; 449 450 ++vm->vm_refcnt; | 63 */ 64 65#include "opt_rlimit.h" 66 67#include <sys/param.h> 68#include <sys/systm.h> 69#include <sys/proc.h> 70#include <sys/resourcevar.h> --- 372 unchanged lines hidden (view full) --- 443 * out. 444 */ 445 if (((action & VM_SWAP_NORMAL) == 0) && 446 (((action & VM_SWAP_IDLE) == 0) || 447 (p->p_slptime < swap_idle_threshold2))) 448 continue; 449 450 ++vm->vm_refcnt; |
451 vm_map_reference(&vm->vm_map); | |
452 /* 453 * do not swapout a process that is waiting for VM 454 * data structures there is a possible deadlock. 455 */ 456 if (lockmgr(&vm->vm_map.lock, 457 LK_EXCLUSIVE | LK_NOWAIT, 458 (void *)0, curproc)) { | 451 /* 452 * do not swapout a process that is waiting for VM 453 * data structures there is a possible deadlock. 454 */ 455 if (lockmgr(&vm->vm_map.lock, 456 LK_EXCLUSIVE | LK_NOWAIT, 457 (void *)0, curproc)) { |
459 vm_map_deallocate(&vm->vm_map); | |
460 vmspace_free(vm); 461 continue; 462 } 463 vm_map_unlock(&vm->vm_map); 464 /* 465 * If the process has been asleep for awhile and had 466 * most of its pages taken away already, swap it out. 467 */ 468 if ((action & VM_SWAP_NORMAL) || 469 ((action & VM_SWAP_IDLE) && 470 (p->p_slptime > swap_idle_threshold2))) { 471 swapout(p); | 458 vmspace_free(vm); 459 continue; 460 } 461 vm_map_unlock(&vm->vm_map); 462 /* 463 * If the process has been asleep for awhile and had 464 * most of its pages taken away already, swap it out. 465 */ 466 if ((action & VM_SWAP_NORMAL) || 467 ((action & VM_SWAP_IDLE) && 468 (p->p_slptime > swap_idle_threshold2))) { 469 swapout(p); |
472 vm_map_deallocate(&vm->vm_map); | |
473 vmspace_free(vm); 474 didswap++; 475 goto retry; 476 } 477 } 478 } 479 /* 480 * If we swapped something out, and another process needed memory, --- 34 unchanged lines hidden --- | 470 vmspace_free(vm); 471 didswap++; 472 goto retry; 473 } 474 } 475 } 476 /* 477 * If we swapped something out, and another process needed memory, --- 34 unchanged lines hidden --- |