vm_glue.c (28992) | vm_glue.c (31016) |
---|---|
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.65 1997/08/21 20:33:42 bde Exp $ | 62 * $Id: vm_glue.c,v 1.66 1997/09/01 03:17:16 bde 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> --- 129 unchanged lines hidden (view full) --- 200 * to user mode to avoid stack copying and relocation problems. 201 */ 202void 203vm_fork(p1, p2, flags) 204 register struct proc *p1, *p2; 205 int flags; 206{ 207 register struct user *up; | 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> --- 129 unchanged lines hidden (view full) --- 200 * to user mode to avoid stack copying and relocation problems. 201 */ 202void 203vm_fork(p1, p2, flags) 204 register struct proc *p1, *p2; 205 int flags; 206{ 207 register struct user *up; |
208 int i; 209 pmap_t pvp; | |
210 211 if (flags & RFMEM) { 212 p2->p_vmspace = p1->p_vmspace; 213 p1->p_vmspace->vm_refcnt++; 214 } 215 216 while ((cnt.v_free_count + cnt.v_cache_count) < cnt.v_free_min) { 217 VM_WAIT; --- 62 unchanged lines hidden (view full) --- 280 p->p_rlimit[RLIMIT_RSS].rlim_cur = ptoa(rss_limit); 281 p->p_rlimit[RLIMIT_RSS].rlim_max = RLIM_INFINITY; 282} 283 284void 285faultin(p) 286 struct proc *p; 287{ | 208 209 if (flags & RFMEM) { 210 p2->p_vmspace = p1->p_vmspace; 211 p1->p_vmspace->vm_refcnt++; 212 } 213 214 while ((cnt.v_free_count + cnt.v_cache_count) < cnt.v_free_min) { 215 VM_WAIT; --- 62 unchanged lines hidden (view full) --- 278 p->p_rlimit[RLIMIT_RSS].rlim_cur = ptoa(rss_limit); 279 p->p_rlimit[RLIMIT_RSS].rlim_max = RLIM_INFINITY; 280} 281 282void 283faultin(p) 284 struct proc *p; 285{ |
288 vm_offset_t i; | |
289 int s; 290 291 if ((p->p_flag & P_INMEM) == 0) { 292 293 ++p->p_lock; 294 295 pmap_swapin_proc(p); 296 --- 156 unchanged lines hidden (view full) --- 453 if (didswap) 454 wakeup(&proc0); 455} 456 457static void 458swapout(p) 459 register struct proc *p; 460{ | 286 int s; 287 288 if ((p->p_flag & P_INMEM) == 0) { 289 290 ++p->p_lock; 291 292 pmap_swapin_proc(p); 293 --- 156 unchanged lines hidden (view full) --- 450 if (didswap) 451 wakeup(&proc0); 452} 453 454static void 455swapout(p) 456 register struct proc *p; 457{ |
461 pmap_t pmap = &p->p_vmspace->vm_pmap; 462 int i; | |
463 464#if defined(SWAP_DEBUG) 465 printf("swapping out %d\n", p->p_pid); 466#endif 467 ++p->p_stats->p_ru.ru_nswap; 468 /* 469 * remember the process resident count 470 */ --- 16 unchanged lines hidden --- | 458 459#if defined(SWAP_DEBUG) 460 printf("swapping out %d\n", p->p_pid); 461#endif 462 ++p->p_stats->p_ru.ru_nswap; 463 /* 464 * remember the process resident count 465 */ --- 16 unchanged lines hidden --- |