From owner-freebsd-arch Wed Jan 2 14:49:29 2002 Delivered-To: freebsd-arch@freebsd.org Received: from srv1.cosmo-project.de (srv1.cosmo-project.de [213.83.6.106]) by hub.freebsd.org (Postfix) with ESMTP id 9098737B419; Wed, 2 Jan 2002 14:49:25 -0800 (PST) Received: (from uucp@localhost) by srv1.cosmo-project.de (8.11.6/8.11.6) with UUCP id g02MnEK03680; Wed, 2 Jan 2002 23:49:14 +0100 (CET) (envelope-from ticso@cicely9.cicely.de) Received: from mail.cicely.de (cicely20.cicely.de [10.1.1.22]) by cicely5.cicely.de (8.12.1/8.12.1) with ESMTP id g02MnZtx045513; Wed, 2 Jan 2002 23:49:35 +0100 (CET)?g (envelope-from ticso@cicely9.cicely.de) Received: from cicely9.cicely.de (cicely9.cicely.de [10.1.7.11]) by mail.cicely.de (8.11.0/8.11.0) with ESMTP id g02MnZW12823; Wed, 2 Jan 2002 23:49:35 +0100 (CET) Received: (from ticso@localhost) by cicely9.cicely.de (8.11.6/8.11.6) id g02MnVI52953; Wed, 2 Jan 2002 23:49:31 +0100 (CET) (envelope-from ticso) Date: Wed, 2 Jan 2002 23:49:31 +0100 From: Bernd Walter To: Matthew Dillon Cc: Michal Mertl , Bruce Evans , Mike Smith , Bernd Walter , arch@FreeBSD.ORG Subject: Re: When to use atomic_ functions? (was: 64 bit counters) Message-ID: <20020102224931.GC10762@cicely9.cicely.de> References: <200201022033.g02KXNV59224@apollo.backplane.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200201022033.g02KXNV59224@apollo.backplane.com> User-Agent: Mutt/1.3.24i X-Operating-System: FreeBSD cicely9.cicely.de 5.0-CURRENT alpha 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 On Wed, Jan 02, 2002 at 12:33:23PM -0800, Matthew Dillon wrote: > : > :I don't know how much time will be wasted - my measurements on pII show > :the atomic_ operations aren't that expensive. > > An atomic operation is not that expensive as long as only one cpu > is touching the cache line. Try running two user processes writing > the same cache line on an SMP system and you will see performance > drop by a factor of 5-10. Just to understand: Your intend is not to use per CPU variables instead of atomic_ functions, but to use atomic_ and per CPU to not clash cache lines. That way it sounds logicaly correct and makes sense for me. Is there a standart mechanism to allocate per CPU memory? It wouldn't make sense if all variables still end up in the same cache line. -- B.Walter COSMO-Project http://www.cosmo-project.de ticso@cicely.de Usergroup info@cosmo-project.de To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message