From owner-freebsd-performance@FreeBSD.ORG Wed Mar 22 18:43:44 2006 Return-Path: X-Original-To: freebsd-performance@freebsd.org Delivered-To: freebsd-performance@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4077E16A48E for ; Wed, 22 Mar 2006 18:43:44 +0000 (UTC) (envelope-from g_jin@lbl.gov) Received: from smtp111.sbc.mail.mud.yahoo.com (smtp111.sbc.mail.mud.yahoo.com [68.142.198.210]) by mx1.FreeBSD.org (Postfix) with SMTP id 7A32143D96 for ; Wed, 22 Mar 2006 18:43:27 +0000 (GMT) (envelope-from g_jin@lbl.gov) Received: (qmail 34168 invoked from network); 22 Mar 2006 18:43:27 -0000 Received: from unknown (HELO ?192.168.2.10?) (jinmtb@sbcglobal.net@68.127.178.44 with plain) by smtp111.sbc.mail.mud.yahoo.com with SMTP; 22 Mar 2006 18:43:27 -0000 Message-ID: <44219B25.9000700@lbl.gov> Date: Wed, 22 Mar 2006 10:44:53 -0800 From: "Jin Guojun [VFFS]" User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.5) Gecko/20050108 X-Accept-Language: zh, zh-CN, en MIME-Version: 1.0 To: Arne Woerner References: <20060322175336.59008.qmail@web30309.mail.mud.yahoo.com> In-Reply-To: <20060322175336.59008.qmail@web30309.mail.mud.yahoo.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Mailman-Approved-At: Wed, 22 Mar 2006 21:22:43 +0000 Cc: freebsd-performance@freebsd.org, Gary Thorpe , oxy@field.hu Subject: Re: packet drop with intel gigabit / marwell gigabit X-BeenThere: freebsd-performance@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Performance/tuning List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Mar 2006 18:43:44 -0000 Arne Woerner wrote: >>Notice that your memory copy speed will be one half of it. >> >> >> >Why "half"? dd causes two copies but counts each byte just once... > >Maybe "dd" in combination with /dev/zero is not the right way to >measure memory bandwidth? > > It depends on how /dev/null implemented. It may just throw data in water. If so, dd only does one CPU to memory access. It is not accurate, but it is a fast way to estimate memory bandwidth. You may write a simple memory copy program to get a better number. If you use 64-bit register (like FP register -- double) to do the copy, on some CPUs, you may double memory copy speed. There are number of tricks to improve system performance. Also, memory copy speed is slightly higher one half of the memory bandwidth. This is because only memory read is 100 % cache missing, while memory write is 100% cache hit. So the memory write speed is based on the last level cache to memory bandwidth + a few cycles overhead for CPU signal the last level cache. For example, 500MB/s memory bandwidth can give you roughly 300 MB/s memory copy speed, not 250 MB/s. -Jin