Deleted Added
full compact
vm_glue.c (50477) vm_glue.c (51337)
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 * $FreeBSD: head/sys/vm/vm_glue.c 50477 1999-08-28 01:08:13Z peter $
62 * $FreeBSD: head/sys/vm/vm_glue.c 51337 1999-09-17 04:56:40Z dillon $
63 */
64
65#include "opt_rlimit.h"
66#include "opt_vm.h"
67
68#include <sys/param.h>
69#include <sys/systm.h>
70#include <sys/proc.h>

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

204{
205 register struct user *up;
206
207 if (flags & RFMEM) {
208 p2->p_vmspace = p1->p_vmspace;
209 p1->p_vmspace->vm_refcnt++;
210 }
211
63 */
64
65#include "opt_rlimit.h"
66#include "opt_vm.h"
67
68#include <sys/param.h>
69#include <sys/systm.h>
70#include <sys/proc.h>

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

204{
205 register struct user *up;
206
207 if (flags & RFMEM) {
208 p2->p_vmspace = p1->p_vmspace;
209 p1->p_vmspace->vm_refcnt++;
210 }
211
212 /*
213 * Great, so we have a memory-heavy process and the
214 * entire machine comes to a screaching halt because
215 * nobody can fork/exec anything. What we really need
216 * to do is fix the process swapper so it swaps out the right
217 * processes.
218 */
219#if 0
220 while ((cnt.v_free_count + cnt.v_cache_count) < cnt.v_free_min) {
221 vm_pageout_deficit += (UPAGES + VM_INITIAL_PAGEIN);
212 while (vm_page_count_severe()) {
222 VM_WAIT;
223 }
213 VM_WAIT;
214 }
224#endif
225
226 if ((flags & RFMEM) == 0) {
227 p2->p_vmspace = vmspace_fork(p1->p_vmspace);
228
229 pmap_pinit2(vmspace_pmap(p2->p_vmspace));
230
231 if (p1->p_vmspace->vm_shm)
232 shmfork(p1, p2);

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

334 void *dummy;
335{
336 register struct proc *p;
337 register int pri;
338 struct proc *pp;
339 int ppri;
340
341loop:
215
216 if ((flags & RFMEM) == 0) {
217 p2->p_vmspace = vmspace_fork(p1->p_vmspace);
218
219 pmap_pinit2(vmspace_pmap(p2->p_vmspace));
220
221 if (p1->p_vmspace->vm_shm)
222 shmfork(p1, p2);

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

324 void *dummy;
325{
326 register struct proc *p;
327 register int pri;
328 struct proc *pp;
329 int ppri;
330
331loop:
342 while ((cnt.v_free_count + cnt.v_cache_count) < cnt.v_free_min) {
332 if (vm_page_count_min()) {
343 VM_WAIT;
333 VM_WAIT;
334 goto loop;
344 }
345
346 pp = NULL;
347 ppri = INT_MIN;
348 for (p = allproc.lh_first; p != 0; p = p->p_list.le_next) {
349 if (p->p_stat == SRUN &&
350 (p->p_flag & (P_INMEM | P_SWAPPING)) == 0) {
351

--- 175 unchanged lines hidden ---
335 }
336
337 pp = NULL;
338 ppri = INT_MIN;
339 for (p = allproc.lh_first; p != 0; p = p->p_list.le_next) {
340 if (p->p_stat == SRUN &&
341 (p->p_flag & (P_INMEM | P_SWAPPING)) == 0) {
342

--- 175 unchanged lines hidden ---