Deleted Added
full compact
vm_glue.c (83366) vm_glue.c (84783)
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 83366 2001-09-12 08:38:13Z julian $
62 * $FreeBSD: head/sys/vm/vm_glue.c 84783 2001-10-10 23:06:54Z ps $
63 */
64
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/lock.h>
71#include <sys/mutex.h>
72#include <sys/proc.h>
73#include <sys/resourcevar.h>

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

323
324 /*
325 * Set up the initial limits on process VM. Set the maximum resident
326 * set size to be half of (reasonably) available memory. Since this
327 * is a soft limit, it comes into effect only when the system is out
328 * of memory - half of main memory helps to favor smaller processes,
329 * and reduces thrashing of the object cache.
330 */
65#include "opt_vm.h"
66
67#include <sys/param.h>
68#include <sys/systm.h>
69#include <sys/lock.h>
70#include <sys/mutex.h>
71#include <sys/proc.h>
72#include <sys/resourcevar.h>

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

322
323 /*
324 * Set up the initial limits on process VM. Set the maximum resident
325 * set size to be half of (reasonably) available memory. Since this
326 * is a soft limit, it comes into effect only when the system is out
327 * of memory - half of main memory helps to favor smaller processes,
328 * and reduces thrashing of the object cache.
329 */
331 p->p_rlimit[RLIMIT_STACK].rlim_cur = DFLSSIZ;
332 p->p_rlimit[RLIMIT_STACK].rlim_max = MAXSSIZ;
333 p->p_rlimit[RLIMIT_DATA].rlim_cur = DFLDSIZ;
334 p->p_rlimit[RLIMIT_DATA].rlim_max = MAXDSIZ;
330 p->p_rlimit[RLIMIT_STACK].rlim_cur = dflssiz;
331 p->p_rlimit[RLIMIT_STACK].rlim_max = maxssiz;
332 p->p_rlimit[RLIMIT_DATA].rlim_cur = dfldsiz;
333 p->p_rlimit[RLIMIT_DATA].rlim_max = maxdsiz;
335 /* limit the limit to no less than 2MB */
336 rss_limit = max(cnt.v_free_count, 512);
337 p->p_rlimit[RLIMIT_RSS].rlim_cur = ptoa(rss_limit);
338 p->p_rlimit[RLIMIT_RSS].rlim_max = RLIM_INFINITY;
339}
340
341/*
342 * Must be called with the proc struc mutex held.

--- 307 unchanged lines hidden ---
334 /* limit the limit to no less than 2MB */
335 rss_limit = max(cnt.v_free_count, 512);
336 p->p_rlimit[RLIMIT_RSS].rlim_cur = ptoa(rss_limit);
337 p->p_rlimit[RLIMIT_RSS].rlim_max = RLIM_INFINITY;
338}
339
340/*
341 * Must be called with the proc struc mutex held.

--- 307 unchanged lines hidden ---