diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c index acfedb8ad0b0..654383b15ec0 100644 --- a/sys/kern/kern_proc.c +++ b/sys/kern/kern_proc.c @@ -1,4 +1,4 @@ -/* $NetBSD: kern_proc.c,v 1.162 2010/02/23 22:19:27 darran Exp $ */ +/* $NetBSD: kern_proc.c,v 1.163 2010/02/26 18:47:13 jym Exp $ */ /*- * Copyright (c) 1999, 2006, 2007, 2008 The NetBSD Foundation, Inc. @@ -62,7 +62,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: kern_proc.c,v 1.162 2010/02/23 22:19:27 darran Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_proc.c,v 1.163 2010/02/26 18:47:13 jym Exp $"); #include "opt_kstack.h" #include "opt_maxuprc.h" @@ -418,7 +418,7 @@ proc0_init(void) limit0.pl_rlimit[RLIMIT_NPROC].rlim_cur = maxproc < maxuprc ? maxproc : maxuprc; - lim = ptoa(uvmexp.free); + lim = MIN(VM_MAXUSER_ADDRESS, ctob((rlim_t)uvmexp.free)); limit0.pl_rlimit[RLIMIT_RSS].rlim_max = lim; limit0.pl_rlimit[RLIMIT_MEMLOCK].rlim_max = lim; limit0.pl_rlimit[RLIMIT_MEMLOCK].rlim_cur = lim / 3;