summaryrefslogtreecommitdiffstats
path: root/sys/kern/init_main.c
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2002-10-09 17:17:24 +0000
committerjhb <jhb@FreeBSD.org>2002-10-09 17:17:24 +0000
commit7cc0ed53c23287ab506f8f86ebbadb958fab6ec7 (patch)
tree3e3a76a37ddfc3f0b9a6307cc20b48df759ba06c /sys/kern/init_main.c
parent984ea4a3cd799fdd0c660a22fffc3f5f40fa100c (diff)
downloadFreeBSD-src-7cc0ed53c23287ab506f8f86ebbadb958fab6ec7.zip
FreeBSD-src-7cc0ed53c23287ab506f8f86ebbadb958fab6ec7.tar.gz
- Move p_cpulimit to struct proc from struct plimit and protect it with
sched_lock. This means that we no longer access p_limit in mi_switch() and the p_limit pointer can be protected by the proc lock. - Remove PRS_ZOMBIE check from CPU limit test in mi_switch(). PRS_ZOMBIE processes don't call mi_switch(), and even if they did there is no longer the danger of p_limit being NULL (which is what the original zombie check was added for). - When we bump the current processes soft CPU limit in ast(), just bump the private p_cpulimit instead of the shared rlimit. This fixes an XXX for some value of fix. There is still a (probably benign) bug in that this code doesn't check that the new soft limit exceeds the hard limit. Inspired by: bde (2)
Diffstat (limited to 'sys/kern/init_main.c')
-rw-r--r--sys/kern/init_main.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c
index 3b97e60..e27958d 100644
--- a/sys/kern/init_main.c
+++ b/sys/kern/init_main.c
@@ -424,8 +424,8 @@ proc0_init(void *dummy __unused)
limit0.pl_rlimit[RLIMIT_RSS].rlim_max = i;
limit0.pl_rlimit[RLIMIT_MEMLOCK].rlim_max = i;
limit0.pl_rlimit[RLIMIT_MEMLOCK].rlim_cur = i / 3;
- limit0.p_cpulimit = RLIM_INFINITY;
limit0.p_refcnt = 1;
+ p->p_cpulimit = RLIM_INFINITY;
/* Allocate a prototype map so we have something to fork. */
pmap_pinit0(vmspace_pmap(&vmspace0));
OpenPOWER on IntegriCloud