From owner-freebsd-performance@FreeBSD.ORG Sun Jan 30 12:16:07 2011 Return-Path: Delivered-To: freebsd-performance@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 178231065673; Sun, 30 Jan 2011 12:16:07 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) by mx1.freebsd.org (Postfix) with ESMTP id 7CB6A8FC08; Sun, 30 Jan 2011 12:16:06 +0000 (UTC) Received: from slw by zxy.spb.ru with local (Exim 4.69 (FreeBSD)) (envelope-from ) id 1PjWCJ-000Pi0-3b; Sun, 30 Jan 2011 15:16:03 +0300 Date: Sun, 30 Jan 2011 15:16:03 +0300 From: Slawa Olhovchenkov To: Robby Sun Message-ID: <20110130121603.GN18170@zxy.spb.ru> References: <20110128143355.GD18170@zxy.spb.ru> <22E77EED-6455-4164-9115-BBD359EC8CA6@moneybookers.com> <20110128161035.GF18170@zxy.spb.ru> <4D42F87C.7020909@freebsd.org> <20110128172516.GG18170@zxy.spb.ru> <20110129070205.Q7034@besplex.bde.org> <20110128215215.GJ18170@zxy.spb.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false Cc: freebsd-performance@freebsd.org, Julian Elischer , Bruce Evans , Stefan Lambrev Subject: Re: Interrupt performance 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: Sun, 30 Jan 2011 12:16:07 -0000 On Sat, Jan 29, 2011 at 09:55:06PM -0800, Robby Sun wrote: > I'd like to suggest that you use the same bit-width for 'Dummy' as that for > 'count', and initialize it to 0, so as to ensure that it won't overflow. I don't use value of Dummy, overflow don't meaning. > -Robby > > On Fri, Jan 28, 2011 at 1:52 PM, Slawa Olhovchenkov wrote: > > > On Sat, Jan 29, 2011 at 07:52:11AM +1100, Bruce Evans wrote: > > > > > >> there are of course several possible answers, including: > > > >> > > > >> 1/ Sometimes BSD and Linux report things differently. Linux may or may > > not > > > >> account for the lowest level interrupt tie the same as BSD > > > > > > > > But I see only 20% idle on FreeBSD and 80% idle on Linux. > > > > > > The time must be counted somewhere, so when it is not properly accounted > > > to packet handling, and nothing much else is running, it is accounted to > > > idle. > > > > > > To see how much CPU is actually available, run something else and see how > > > fast it runs. A simple counting loops works well on UP systems. > > > > === > > #include > > #include > > > > int Dummy; > > > > int > > main(int argc, char *argv[]) > > { > > long int count,i,dt; > > struct timeval st,et; > > > > count = atol(argv[1]); > > > > gettimeofday(&st, NULL); > > for(i=count;i;i--) Dummy++; > > gettimeofday(&et, NULL); > > dt = (et.tv_sec-st.tv_sec)*1000000 + et.tv_usec-st.tv_usec; > > printf("Elapsed %d us\n",dt); > > } > > === > > > > This is ok? > > > > ./loop 2000000000 > > > > FreeBSD > > 1 process: Elapsed 7554193 us > > 2 process: Elapsed 14493692 us > > netperf + 1 process: Elapsed 21403644 us > > > > Linux > > 1 process: Elapsed 7524843 us > > 2 process: Elapsed 14995866 us > > netperf + 1 process: Elapsed 14107670 us > > > > > _______________________________________________ > freebsd-performance@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-performance > To unsubscribe, send any mail to "freebsd-performance-unsubscribe@freebsd.org"