kern_proc.c (92723) | kern_proc.c (92751) |
---|---|
1/* 2 * Copyright (c) 1982, 1986, 1989, 1991, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 17 unchanged lines hidden (view full) --- 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 * 33 * @(#)kern_proc.c 8.7 (Berkeley) 2/14/95 | 1/* 2 * Copyright (c) 1982, 1986, 1989, 1991, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 17 unchanged lines hidden (view full) --- 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 * 33 * @(#)kern_proc.c 8.7 (Berkeley) 2/14/95 |
34 * $FreeBSD: head/sys/kern/kern_proc.c 92723 2002-03-19 21:25:46Z alfred $ | 34 * $FreeBSD: head/sys/kern/kern_proc.c 92751 2002-03-20 04:09:59Z jeff $ |
35 */ 36 37#include <sys/param.h> 38#include <sys/systm.h> 39#include <sys/kernel.h> 40#include <sys/lock.h> 41#include <sys/malloc.h> 42#include <sys/mutex.h> --- 5 unchanged lines hidden (view full) --- 48#include <sys/signalvar.h> 49#include <sys/sx.h> 50#include <sys/user.h> 51#include <sys/jail.h> 52 53#include <vm/vm.h> 54#include <vm/pmap.h> 55#include <vm/vm_map.h> | 35 */ 36 37#include <sys/param.h> 38#include <sys/systm.h> 39#include <sys/kernel.h> 40#include <sys/lock.h> 41#include <sys/malloc.h> 42#include <sys/mutex.h> --- 5 unchanged lines hidden (view full) --- 48#include <sys/signalvar.h> 49#include <sys/sx.h> 50#include <sys/user.h> 51#include <sys/jail.h> 52 53#include <vm/vm.h> 54#include <vm/pmap.h> 55#include <vm/vm_map.h> |
56#include <vm/vm_zone.h> | 56#include <vm/uma.h> |
57 58MALLOC_DEFINE(M_PGRP, "pgrp", "process group header"); 59MALLOC_DEFINE(M_SESSION, "session", "session header"); 60static MALLOC_DEFINE(M_PROC, "proc", "Proc structures"); 61MALLOC_DEFINE(M_SUBPROC, "subproc", "Proc sub-structures"); 62 63static struct proc *dopfind (register pid_t); 64 --- 10 unchanged lines hidden (view full) --- 75u_long pidhash; 76struct pgrphashhead *pgrphashtbl; 77u_long pgrphash; 78struct proclist allproc; 79struct proclist zombproc; 80struct sx allproc_lock; 81struct sx proctree_lock; 82struct sx pgrpsess_lock; | 57 58MALLOC_DEFINE(M_PGRP, "pgrp", "process group header"); 59MALLOC_DEFINE(M_SESSION, "session", "session header"); 60static MALLOC_DEFINE(M_PROC, "proc", "Proc structures"); 61MALLOC_DEFINE(M_SUBPROC, "subproc", "Proc sub-structures"); 62 63static struct proc *dopfind (register pid_t); 64 --- 10 unchanged lines hidden (view full) --- 75u_long pidhash; 76struct pgrphashhead *pgrphashtbl; 77u_long pgrphash; 78struct proclist allproc; 79struct proclist zombproc; 80struct sx allproc_lock; 81struct sx proctree_lock; 82struct sx pgrpsess_lock; |
83vm_zone_t proc_zone; 84vm_zone_t ithread_zone; | 83uma_zone_t proc_zone; 84uma_zone_t ithread_zone; |
85 86/* 87 * Initialize global process hashing structures. 88 */ 89void 90procinit() 91{ 92 int i, j; 93 94 sx_init(&allproc_lock, "allproc"); 95 sx_init(&proctree_lock, "proctree"); 96 sx_init(&pgrpsess_lock, "pgrpsess"); 97 LIST_INIT(&allproc); 98 LIST_INIT(&zombproc); 99 pidhashtbl = hashinit(maxproc / 4, M_PROC, &pidhash); 100 pgrphashtbl = hashinit(maxproc / 4, M_PROC, &pgrphash); | 85 86/* 87 * Initialize global process hashing structures. 88 */ 89void 90procinit() 91{ 92 int i, j; 93 94 sx_init(&allproc_lock, "allproc"); 95 sx_init(&proctree_lock, "proctree"); 96 sx_init(&pgrpsess_lock, "pgrpsess"); 97 LIST_INIT(&allproc); 98 LIST_INIT(&zombproc); 99 pidhashtbl = hashinit(maxproc / 4, M_PROC, &pidhash); 100 pgrphashtbl = hashinit(maxproc / 4, M_PROC, &pgrphash); |
101 proc_zone = zinit("PROC", sizeof (struct proc), 0, 0, 5); | 101 proc_zone = uma_zcreate("PROC", sizeof (struct proc), NULL, NULL, 102 NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE); |
102 uihashinit(); 103 /* 104 * This should really be a compile time warning, but I do 105 * not know of any way to do that... 106 */ 107 if (sizeof(struct kinfo_proc) != KINFO_PROC_SIZE) { 108 printf("This message will repeat for the next 20 seconds\n"); 109 for (i = 0; i < 20; i++) { --- 916 unchanged lines hidden --- | 103 uihashinit(); 104 /* 105 * This should really be a compile time warning, but I do 106 * not know of any way to do that... 107 */ 108 if (sizeof(struct kinfo_proc) != KINFO_PROC_SIZE) { 109 printf("This message will repeat for the next 20 seconds\n"); 110 for (i = 0; i < 20; i++) { --- 916 unchanged lines hidden --- |