diff options
author | Philip Guenthe <guenther@cvs.openbsd.org> | 2012-04-10 15:50:53 +0000 |
---|---|---|
committer | Philip Guenthe <guenther@cvs.openbsd.org> | 2012-04-10 15:50:53 +0000 |
commit | e8a9a9f2d6489645bf13279629f174fbbb51e5f2 (patch) | |
tree | 6c4388beca9c54cb18ca390586c38d8057a8a342 /sys/arch | |
parent | 213c6b55ddb4168cc2df478c206d9f8db6bfac38 (diff) |
Make the KERN_NPROCS and KERN_MAXPROC sysctl()s and the RLIMIT_NPROC rlimit
count processes instead of threads. New sysctl()s KERN_NTHREADS and
KERN_MAXTHREAD count and limit threads. The nprocs and maxproc kernel
variables are replaced by nprocess, maxprocess, nthreads, and maxthread.
ok tedu@ mikeb@
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/alpha/alpha/pmap.c | 4 | ||||
-rw-r--r-- | sys/arch/arm/arm/pmap.c | 5 | ||||
-rw-r--r-- | sys/arch/m68k/m68k/pmap_motorola.c | 14 | ||||
-rw-r--r-- | sys/arch/vax/vax/pmap.c | 8 |
4 files changed, 15 insertions, 16 deletions
diff --git a/sys/arch/alpha/alpha/pmap.c b/sys/arch/alpha/alpha/pmap.c index 4d089612977..f1d54deac8c 100644 --- a/sys/arch/alpha/alpha/pmap.c +++ b/sys/arch/alpha/alpha/pmap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.c,v 1.62 2011/11/16 20:50:17 deraadt Exp $ */ +/* $OpenBSD: pmap.c,v 1.63 2012/04/10 15:50:52 guenther Exp $ */ /* $NetBSD: pmap.c,v 1.154 2000/12/07 22:18:55 thorpej Exp $ */ /*- @@ -757,7 +757,7 @@ pmap_bootstrap(paddr_t ptaddr, u_int maxasn, u_long ncpuids) * Figure out how many PTE's are necessary to map the kernel. */ lev3mapsize = (VM_PHYS_SIZE + 16 * NCARGS + PAGER_MAP_SIZE) / - PAGE_SIZE + (maxproc * UPAGES) + nkmempages; + PAGE_SIZE + (maxthread * UPAGES) + nkmempages; #ifdef SYSVSHM lev3mapsize += shminfo.shmall; diff --git a/sys/arch/arm/arm/pmap.c b/sys/arch/arm/arm/pmap.c index a04cad57dd9..f1137fd32d6 100644 --- a/sys/arch/arm/arm/pmap.c +++ b/sys/arch/arm/arm/pmap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.c,v 1.35 2011/11/09 10:15:49 miod Exp $ */ +/* $OpenBSD: pmap.c,v 1.36 2012/04/10 15:50:52 guenther Exp $ */ /* $NetBSD: pmap.c,v 1.147 2004/01/18 13:03:50 scw Exp $ */ /* @@ -4169,8 +4169,7 @@ pmap_postinit(void) pool_setlowat(&pmap_l2dtable_pool, (PAGE_SIZE / sizeof(struct l2_dtable)) * 2); - needed = (maxproc / PMAP_DOMAINS) + ((maxproc % PMAP_DOMAINS) ? 1 : 0); - needed -= 1; + needed = (maxprocess - 1) / PMAP_DOMAINS l1 = malloc(sizeof(*l1) * needed, M_VMPMAP, M_WAITOK); diff --git a/sys/arch/m68k/m68k/pmap_motorola.c b/sys/arch/m68k/m68k/pmap_motorola.c index 63f70ffd5ec..ba96b504a12 100644 --- a/sys/arch/m68k/m68k/pmap_motorola.c +++ b/sys/arch/m68k/m68k/pmap_motorola.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap_motorola.c,v 1.66 2011/11/01 21:20:55 miod Exp $ */ +/* $OpenBSD: pmap_motorola.c,v 1.67 2012/04/10 15:50:52 guenther Exp $ */ /* * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -454,7 +454,7 @@ pmap_init() * Allocate physical memory for kernel PT pages and their management. * We need 1 PT page per possible task plus some slop. */ - npages = min(atop(MACHINE_MAX_KPTSIZE), maxproc+16); + npages = min(atop(MACHINE_MAX_KPTSIZE), maxprocess+16); s = ptoa(npages) + round_page(npages * sizeof(struct kpt_page)); /* @@ -495,7 +495,7 @@ pmap_init() /* * Allocate the segment table map and the page table map. */ - s = maxproc * MACHINE_STSIZE; + s = maxprocess * MACHINE_STSIZE; st_map = uvm_km_suballoc(kernel_map, &addr, &addr2, s, 0, FALSE, &st_map_store); @@ -519,17 +519,17 @@ pmap_init() Sysseg, Sysmap, Sysptmap)); addr = MACHINE_PTBASE; - if ((MACHINE_PTMAXSIZE / MACHINE_MAX_PTSIZE) < maxproc) { + if ((MACHINE_PTMAXSIZE / MACHINE_MAX_PTSIZE) < maxprocess) { s = MACHINE_PTMAXSIZE; /* * XXX We don't want to hang when we run out of - * page tables, so we lower maxproc so that fork() + * page tables, so we lower maxprocess so that fork() * will fail instead. Note that root could still raise * this value via sysctl(3). */ - maxproc = (MACHINE_PTMAXSIZE / MACHINE_MAX_PTSIZE); + maxprocess = (MACHINE_PTMAXSIZE / MACHINE_MAX_PTSIZE); } else - s = (maxproc * MACHINE_MAX_PTSIZE); + s = (maxprocess * MACHINE_MAX_PTSIZE); pt_map = uvm_km_suballoc(kernel_map, &addr, &addr2, s, 0, TRUE, &pt_map_store); diff --git a/sys/arch/vax/vax/pmap.c b/sys/arch/vax/vax/pmap.c index 651dafc2f0c..eebcc0ad66f 100644 --- a/sys/arch/vax/vax/pmap.c +++ b/sys/arch/vax/vax/pmap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.c,v 1.53 2011/07/06 18:33:00 miod Exp $ */ +/* $OpenBSD: pmap.c,v 1.54 2012/04/10 15:50:52 guenther Exp $ */ /* $NetBSD: pmap.c,v 1.74 1999/11/13 21:32:25 matt Exp $ */ /* * Copyright (c) 1994, 1998, 1999 Ludd, University of Lule}, Sweden. @@ -130,13 +130,13 @@ pmap_bootstrap() */ /* Kernel alloc area */ - sysptsize = (((0x100000 * maxproc) >> VAX_PGSHIFT) / 4); + sysptsize = (((0x100000 * maxprocess) >> VAX_PGSHIFT) / 4); /* reverse mapping struct */ sysptsize += (avail_end >> VAX_PGSHIFT) * 2; /* User Page table area. This may grow big */ - sysptsize += ((USRPTSIZE * 4) / VAX_NBPG) * maxproc; + sysptsize += ((USRPTSIZE * 4) / VAX_NBPG) * maxprocess; /* Kernel stacks per process */ - sysptsize += UPAGES * maxproc; + sysptsize += UPAGES * maxthread; /* IO device register space */ sysptsize += IOSPSZ; |