From owner-freebsd-hackers@FreeBSD.ORG Wed Jun 25 08:11:00 2003 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B12C137B401; Wed, 25 Jun 2003 08:11:00 -0700 (PDT) Received: from godel.mtl.distributel.net (nat.MTL.distributel.NET [66.38.181.24]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0BAE543FBF; Wed, 25 Jun 2003 08:11:00 -0700 (PDT) (envelope-from bmilekic@technokratis.com) Received: from godel.mtl.distributel.net (localhost [127.0.0.1]) h5PBDcCa004497; Wed, 25 Jun 2003 11:13:38 GMT (envelope-from bmilekic@technokratis.com) Received: (from bmilekic@localhost) by godel.mtl.distributel.net (8.12.9/8.12.9/Submit) id h5PBDb34004496; Wed, 25 Jun 2003 11:13:37 GMT X-Authentication-Warning: godel.mtl.distributel.net: bmilekic set sender to bmilekic@technokratis.com using -f Date: Wed, 25 Jun 2003 11:13:37 +0000 From: Bosko Milekic To: Bruce M Simpson , freebsd-hackers@freebsd.org, alc@freebsd.org, jmallett@freebsd.org Message-ID: <20030625111337.GA4383@technokratis.com> References: <20030624193431.GW9463@spc.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030624193431.GW9463@spc.org> User-Agent: Mutt/1.4.1i Subject: Re: Optimizing mutex alignment viz cache line access X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jun 2003 15:11:01 -0000 On Tue, Jun 24, 2003 at 08:34:31PM +0100, Bruce M Simpson wrote: [...] > Would the workaround, then, not be to modify the mtx_*() set of functions > to use a zone allocator, whose allocation function could then be tuned to > allocate the lock structure which is frobbed by the atomic_*() functions > on separate cache lines? > > BMS Not all mutexes are dynamically allocated. Also, you have to really be careful here. There may not be much of a point in spending all this time re-aligning the actual lock knob in the structure, which is accessed atomically with the bus locked all the time. There are a lot of structures which could probably be re-organized for cache gain purposes but at this point we have so many structures changing so quickly that this sort of change becomes difficult to do properly. -- Bosko Milekic * bmilekic@technokratis.com * bmilekic@FreeBSD.org TECHNOkRATIS Consulting Services * http://www.technokratis.com/