From owner-cvs-all Thu Oct 12 15:45:27 2000 Delivered-To: cvs-all@freebsd.org Received: from magnesium.net (toxic.magnesium.net [207.154.84.15]) by hub.freebsd.org (Postfix) with SMTP id 8A51237B502 for ; Thu, 12 Oct 2000 15:45:24 -0700 (PDT) Received: (qmail 13685 invoked by uid 1142); 12 Oct 2000 22:45:19 -0000 Date: 12 Oct 2000 15:45:19 -0700 Date: Thu, 12 Oct 2000 15:45:02 -0700 From: Jason Evans To: Jason Evans Cc: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/conf param.c src/sys/kern kern_lock.c src/sys/sys kernel.h lock.h src/sys/vm vm_map.h Message-ID: <20001012154502.E11949@canonware.com> References: <200010122237.PAA12428@freefall.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <200010122237.PAA12428@freefall.freebsd.org>; from jasone@FreeBSD.org on Thu, Oct 12, 2000 at 03:37:29PM -0700 Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Thu, Oct 12, 2000 at 03:37:29PM -0700, Jason Evans wrote: > Modified files: > sys/conf param.c > sys/kern kern_lock.c > sys/sys kernel.h lock.h > sys/vm vm_map.h > Log: > For lockmgr mutex protection, use an array of mutexes that are allocated > and initialized during boot. This avoids bloating sizeof(struct lock). > As a side effect, it is no longer necessary to enforce the assumtion that > lockinit()/lockdestroy() calls are paired, so the LK_VALID flag has been > removed. A number of people have complained about a major performance drop starting with the commit of my initial lockmgr changes on ~3 October. Those changes caused many mutexes to be added to the system, with lots of calls to mtx_init()/mtx_destroy(), which then call mtx_validate() if the SMP_DEBUG option is enabled. mtx_validate() iterates through all the mutexes to look for problems, so things were very slow. This latest commit drastically reduces the number of mutexes (from potentially thousands down to 11), and lockinit()/lockdestroy() no longer cause mtx_init()/mtx_destroy() to be called, so the slowdown should go away. Jason To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message