Deleted Added
full compact
vm_glue.c (10358) vm_glue.c (10653)
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.23 1995/07/13 08:48:21 davidg Exp $
62 * $Id: vm_glue.c,v 1.24 1995/08/28 09:19:22 julian Exp $
63 */
64
65#include <sys/param.h>
66#include <sys/systm.h>
67#include <sys/proc.h>
68#include <sys/resourcevar.h>
69#include <sys/buf.h>
70#include <sys/shm.h>

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

82#include <machine/cpu.h>
83
84/*
85 * System initialization
86 *
87 * Note: proc0 from proc.h
88 */
89
63 */
64
65#include <sys/param.h>
66#include <sys/systm.h>
67#include <sys/proc.h>
68#include <sys/resourcevar.h>
69#include <sys/buf.h>
70#include <sys/shm.h>

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

82#include <machine/cpu.h>
83
84/*
85 * System initialization
86 *
87 * Note: proc0 from proc.h
88 */
89
90static void vm_init_limits __P((caddr_t));
91SYSINIT(vm_limits, SI_SUB_VM_CONF, SI_ORDER_FIRST, vm_init_limits, (caddr_t)&proc0)
90static void vm_init_limits __P((void *));
91SYSINIT(vm_limits, SI_SUB_VM_CONF, SI_ORDER_FIRST, vm_init_limits, &proc0)
92
93/*
94 * THIS MUST BE THE LAST INITIALIZATION ITEM!!!
95 *
96 * Note: run scheduling should be divorced from the vm system.
97 */
92
93/*
94 * THIS MUST BE THE LAST INITIALIZATION ITEM!!!
95 *
96 * Note: run scheduling should be divorced from the vm system.
97 */
98static void scheduler __P((caddr_t));
98static void scheduler __P((void *));
99SYSINIT(scheduler, SI_SUB_RUN_SCHEDULER, SI_ORDER_FIRST, scheduler, NULL)
100
101
102extern char kstack[];
103
104/* vm_map_t upages_map; */
105
106int

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

281
282/*
283 * Set default limits for VM system.
284 * Called for proc 0, and then inherited by all others.
285 *
286 * XXX should probably act directly on proc0.
287 */
288static void
99SYSINIT(scheduler, SI_SUB_RUN_SCHEDULER, SI_ORDER_FIRST, scheduler, NULL)
100
101
102extern char kstack[];
103
104/* vm_map_t upages_map; */
105
106int

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

281
282/*
283 * Set default limits for VM system.
284 * Called for proc 0, and then inherited by all others.
285 *
286 * XXX should probably act directly on proc0.
287 */
288static void
289vm_init_limits( udata)
290caddr_t udata;
289vm_init_limits(udata)
290 void *udata;
291{
292 register struct proc *p = (struct proc *)udata;
293 int rss_limit;
294
295 /*
296 * Set up the initial limits on process VM. Set the maximum resident
297 * set size to be half of (reasonably) available memory. Since this
298 * is a soft limit, it comes into effect only when the system is out

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

359
360/*
361 * This swapin algorithm attempts to swap-in processes only if there
362 * is enough space for them. Of course, if a process waits for a long
363 * time, it will be swapped in anyway.
364 */
365/* ARGSUSED*/
366static void
291{
292 register struct proc *p = (struct proc *)udata;
293 int rss_limit;
294
295 /*
296 * Set up the initial limits on process VM. Set the maximum resident
297 * set size to be half of (reasonably) available memory. Since this
298 * is a soft limit, it comes into effect only when the system is out

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

359
360/*
361 * This swapin algorithm attempts to swap-in processes only if there
362 * is enough space for them. Of course, if a process waits for a long
363 * time, it will be swapped in anyway.
364 */
365/* ARGSUSED*/
366static void
367scheduler( udata)
368caddr_t udata; /* not used*/
367scheduler(udata)
368 void *udata; /* not used*/
369{
370 register struct proc *p;
371 register int pri;
372 struct proc *pp;
373 int ppri;
374
375loop:
376 while ((cnt.v_free_count + cnt.v_cache_count) < (cnt.v_free_reserved + UPAGES + 2)) {

--- 186 unchanged lines hidden ---
369{
370 register struct proc *p;
371 register int pri;
372 struct proc *pp;
373 int ppri;
374
375loop:
376 while ((cnt.v_free_count + cnt.v_cache_count) < (cnt.v_free_reserved + UPAGES + 2)) {

--- 186 unchanged lines hidden ---