From owner-cvs-all Tue Apr 3 9:19:37 2001 Delivered-To: cvs-all@freebsd.org Received: from pike.osd.bsdi.com (pike.osd.bsdi.com [204.216.28.222]) by hub.freebsd.org (Postfix) with ESMTP id 11C5137B71C; Tue, 3 Apr 2001 09:19:30 -0700 (PDT) (envelope-from jhb@foo.osd.bsdi.com) Received: from foo.osd.bsdi.com (root@foo.osd.bsdi.com [204.216.28.137]) by pike.osd.bsdi.com (8.11.1/8.9.3) with ESMTP id f33GJTK45885; Tue, 3 Apr 2001 09:19:29 -0700 (PDT) (envelope-from jhb@foo.osd.bsdi.com) Received: (from jhb@localhost) by foo.osd.bsdi.com (8.11.1/8.11.1) id f33GI7C18191; Tue, 3 Apr 2001 09:18:07 -0700 (PDT) (envelope-from jhb) Message-ID: X-Mailer: XFMail 1.4.0 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <200104030315.f333FCX69312@freefall.freebsd.org> Date: Tue, 03 Apr 2001 09:18:07 -0700 (PDT) Organization: BSD, Inc. From: John Baldwin To: Alfred Perlstein Subject: RE: cvs commit: src/sys/sys mbuf.h src/sys/kern uipc_mbuf.c Cc: cvs-all@FreeBSD.org, cvs-committers@FreeBSD.org Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On 03-Apr-01 Alfred Perlstein wrote: > alfred 2001/04/02 20:15:12 PDT > > Modified files: > sys/sys mbuf.h > sys/kern uipc_mbuf.c > Log: > Use only one mutex for the entire mbuf subsystem. > > Don't use atomic operations for the stats updating, instead protect > the counts with the mbuf mutex. Most twiddling of the stats was > done right before or after releasing a mutex. By doing this we > reduce the number of locked ops needed as well as allow a sysctl > to gain a consitant view of the entire stats structure. > > In the future... > > This will allow us to chain common mbuf operations that would > normally need to aquire/release 2 or 3 of the locks to build an > mbuf with a cluster or external data attached into a single op > requiring only one lock. > > Simplify the per-cpu locks that are planned. > > There's also some if (1) code that should check if the "how" > operation specifies blocking/non-blocking behavior, we _could_ make > it so that we hold onto the mutex through calls into kmem_alloc > when non-blocking requests are made, but for safety reasons we > currently drop and reaquire the mutex around the calls. > > Also, note that calling kmem_alloc is rare and only happens during > a shortage so drop/re-getting the mutex will not be a common > occurance. It is perfectly safe to drop the lock so long as the mbuf subsystem is in a consistent state before calling kmem_alloc(). > Remove some #define's that seemed to obfuscate the code to me. > > Remove an extranious comment. > > Remove an XXX, including mutex.h isn't a crime. Yes it is, and is going away soon. :) It will also be leaving other headers such as sys/ucred.h, sys/resourcevar.h, etc. -- John Baldwin -- http://www.FreeBSD.org/~jhb/ PGP Key: http://www.Baldwin.cx/~john/pgpkey.asc "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message