From owner-freebsd-arch Wed Feb 27 12:23:49 2002 Delivered-To: freebsd-arch@freebsd.org Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by hub.freebsd.org (Postfix) with ESMTP id 152C237B429 for ; Wed, 27 Feb 2002 12:23:33 -0800 (PST) Received: by elvis.mu.org (Postfix, from userid 1192) id D3BC7AE2BE; Wed, 27 Feb 2002 12:23:32 -0800 (PST) Date: Wed, 27 Feb 2002 12:23:32 -0800 From: Alfred Perlstein To: Julian Elischer Cc: Bosko Milekic , Terry Lambert , Jeff Roberson , arch@FreeBSD.ORG Subject: Re: Slab allocator Message-ID: <20020227202332.GU80761@elvis.mu.org> References: <20020227150519.A42681@unixdaemons.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.3.27i Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG * Julian Elischer [020227 12:20] wrote: > > > On Wed, 27 Feb 2002, Bosko Milekic wrote: > > > > > On Wed, Feb 27, 2002 at 11:41:50AM -0800, Julian Elischer wrote: > > > The idea of Per CPU caches is that only that CPU is accessing it so > > > therefore you shouldn't need a lock at all. unless you are protecting > > > against interrupts on your own processor > > > and pre-emption. There are also ways to implement atomic > > > operations on queues that require no locks at all. > > > (e.g. using the test and swap instruction) > > > > Yes, that's exactly the point. You have to protect against pre-emption > > and interrupts. > maybe use a critical section instead.. > or better, a test/swap > or, both... > > but it sounds like you need the lock anyhow because > as you said.. it is possible a recently pre-empted thread may continue > to use the pool of it's old processor for a short moment, > (I'm not sure I like that idea) Leave it alone. The locks are a perfectly fine abstraction for the time being to get what we want and need. I'm for the per-cpu locks, and we can remove/fix them later if it's an issue. Removing locks is easier than adding them imo. -- -Alfred Perlstein [alfred@freebsd.org] 'Instead of asking why a piece of software is using "1970s technology," start asking why software is ignoring 30 years of accumulated wisdom.' Tax deductible donations for FreeBSD: http://www.freebsdfoundation.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message