Deleted Added
full compact
vm_glue.c (9507) vm_glue.c (10358)
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.22 1995/07/10 08:53:20 davidg Exp $
62 * $Id: vm_glue.c,v 1.23 1995/07/13 08:48:21 davidg 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>

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

76#include <vm/vm.h>
77#include <vm/vm_page.h>
78#include <vm/vm_pageout.h>
79#include <vm/vm_kern.h>
80
81#include <machine/stdarg.h>
82#include <machine/cpu.h>
83
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>

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

76#include <vm/vm.h>
77#include <vm/vm_page.h>
78#include <vm/vm_pageout.h>
79#include <vm/vm_kern.h>
80
81#include <machine/stdarg.h>
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)
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));
99SYSINIT(scheduler, SI_SUB_RUN_SCHEDULER, SI_ORDER_FIRST, scheduler, NULL)
100
101
84extern char kstack[];
85
86/* vm_map_t upages_map; */
87
88int
89kernacc(addr, len, rw)
90 caddr_t addr;
91 int len, rw;

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

259 * process and once in the child.
260 */
261 return (cpu_fork(p1, p2));
262}
263
264/*
265 * Set default limits for VM system.
266 * Called for proc 0, and then inherited by all others.
102extern char kstack[];
103
104/* vm_map_t upages_map; */
105
106int
107kernacc(addr, len, rw)
108 caddr_t addr;
109 int len, rw;

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

277 * process and once in the child.
278 */
279 return (cpu_fork(p1, p2));
280}
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.
267 */
287 */
268void
269vm_init_limits(p)
270 register struct proc *p;
288static void
289vm_init_limits( udata)
290caddr_t udata;
271{
291{
292 register struct proc *p = (struct proc *)udata;
272 int rss_limit;
273
274 /*
275 * Set up the initial limits on process VM. Set the maximum resident
276 * set size to be half of (reasonably) available memory. Since this
277 * is a soft limit, it comes into effect only when the system is out
278 * of memory - half of main memory helps to favor smaller processes,
279 * and reduces thrashing of the object cache.

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

336 }
337}
338
339/*
340 * This swapin algorithm attempts to swap-in processes only if there
341 * is enough space for them. Of course, if a process waits for a long
342 * time, it will be swapped in anyway.
343 */
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
299 * of memory - half of main memory helps to favor smaller processes,
300 * and reduces thrashing of the object cache.

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

357 }
358}
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 */
344void
345scheduler()
365/* ARGSUSED*/
366static void
367scheduler( udata)
368caddr_t udata; /* not used*/
346{
347 register struct proc *p;
348 register int pri;
349 struct proc *pp;
350 int ppri;
351
352loop:
353 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 ---