Date: Wed, 2 Jan 2002 23:49:31 +0100 From: Bernd Walter <ticso@cicely9.cicely.de> To: Matthew Dillon <dillon@apollo.backplane.com> Cc: Michal Mertl <mime@traveller.cz>, Bruce Evans <bde@zeta.org.au>, Mike Smith <msmith@FreeBSD.ORG>, Bernd Walter <ticso@cicely8.cicely.de>, arch@FreeBSD.ORG Subject: Re: When to use atomic_ functions? (was: 64 bit counters) Message-ID: <20020102224931.GC10762@cicely9.cicely.de> In-Reply-To: <200201022033.g02KXNV59224@apollo.backplane.com> References: <Pine.BSF.4.41.0201021003580.18429-100000@prg.traveller.cz> <200201022033.g02KXNV59224@apollo.backplane.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020102224931.GC10762>