From owner-freebsd-arch Wed Jan 2 12:43:57 2002 Delivered-To: freebsd-arch@freebsd.org Received: from hawk.prod.itd.earthlink.net (hawk.mail.pas.earthlink.net [207.217.120.22]) by hub.freebsd.org (Postfix) with ESMTP id 3F23E37B417; Wed, 2 Jan 2002 12:43:50 -0800 (PST) Received: from pool0051.cvx40-bradley.dialup.earthlink.net ([216.244.42.51] helo=mindspring.com) by hawk.prod.itd.earthlink.net with esmtp (Exim 3.33 #1) id 16LsEP-0003K8-00; Wed, 02 Jan 2002 12:43:25 -0800 Message-ID: <3C3370EE.7621E667@mindspring.com> Date: Wed, 02 Jan 2002 12:43:26 -0800 From: Terry Lambert X-Mailer: Mozilla 4.7 [en]C-CCK-MCD {Sony} (Win98; U) X-Accept-Language: en MIME-Version: 1.0 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) References: <200201022033.g02KXNV59224@apollo.backplane.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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 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. Matt is correct (if in doubt, Matt is usually correct 8-)). The only way to address this decently is to reduce contention domains in the design. Initially, this won't happen; I expect that it will have to come subsystem by subsystem at a later date, as people hit performance bottlenecks. > Now, of course, we could lock each interface to a particular cpu. There > are advantages to doing that. This is something that should at least be permitted by any final design, if not actively encouraged, or implemented up front. This is what NT did to beat Linux on the MindCraft and other benchmarks. There are also some serious penalties associated with the way FreeBSD does it now (interrupts are wired to the sole CPU in the kernel) and the way Intel wants it done (virtual wire mode means every CPU gets an IPI), and both of these limit scalability significantly. -- Terry To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message