From owner-cvs-all Tue Sep 5 15:11:18 2000 Delivered-To: cvs-all@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 1D46A37B43F; Tue, 5 Sep 2000 15:11:14 -0700 (PDT) Received: (from truckman@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id PAA70424; Tue, 5 Sep 2000 15:11:14 -0700 (PDT) (envelope-from truckman@FreeBSD.org) Message-Id: <200009052211.PAA70424@freefall.freebsd.org> From: Don Lewis Date: Tue, 5 Sep 2000 15:11:13 -0700 (PDT) To: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/sys/kern init_main.c kern_exec.c kern_exit.c kern_fork.c kern_proc.c kern_prot.c kern_resource.c uipc_socket.c uipc_socket2.c uipc_usrreq.c vfs_aio.c src/sys/sys proc.h resourcevar.h ucred.h X-FreeBSD-CVS-Branch: HEAD Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG truckman 2000/09/05 15:11:13 PDT Modified files: sys/kern init_main.c kern_exec.c kern_exit.c kern_fork.c kern_proc.c kern_prot.c kern_resource.c uipc_socket.c uipc_socket2.c uipc_usrreq.c vfs_aio.c sys/sys proc.h resourcevar.h ucred.h Log: Remove uidinfo hash table lookup and maintenance out of chgproccnt() and chgsbsize(), which are called rather frequently and may be called from an interrupt context in the case of chgsbsize(). Instead, do the hash table lookup and maintenance when credentials are changed, which is a lot less frequent. Add pointers to the uidinfo structures to the ucred and pcred structures for fast access. Pass a pointer to the credential to chgproccnt() and chgsbsize() instead of passing the uid. Add a reference count to the uidinfo structure and use it to decide when to free the structure rather than freeing the structure when the resource consumption drops to zero. Move the resource tracking code from kern_proc.c to kern_resource.c. Move some duplicate code sequences in kern_prot.c to separate helper functions. Change KASSERTs in this code to unconditional tests and calls to panic(). Revision Changes Path 1.141 +4 -2 src/sys/kern/init_main.c 1.113 +3 -2 src/sys/kern/kern_exec.c 1.100 +3 -2 src/sys/kern/kern_exit.c 1.80 +4 -2 src/sys/kern/kern_fork.c 1.74 +2 -137 src/sys/kern/kern_proc.c 1.63 +71 -21 src/sys/kern/kern_prot.c 1.61 +143 -1 src/sys/kern/kern_resource.c 1.82 +3 -3 src/sys/kern/uipc_socket.c 1.65 +4 -3 src/sys/kern/uipc_socket2.c 1.60 +3 -3 src/sys/kern/uipc_usrreq.c 1.80 +3 -1 src/sys/kern/vfs_aio.c 1.110 +2 -3 src/sys/sys/proc.h 1.17 +21 -1 src/sys/sys/resourcevar.h 1.15 +3 -1 src/sys/sys/ucred.h To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message