From owner-freebsd-hackers@FreeBSD.ORG Thu Sep 14 18:07:08 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B234B16A40F for ; Thu, 14 Sep 2006 18:07:08 +0000 (UTC) (envelope-from gcorcoran@rcn.com) Received: from smtp02.lnh.mail.rcn.net (smtp02.lnh.mail.rcn.net [207.172.157.102]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1B35043D70 for ; Thu, 14 Sep 2006 18:07:07 +0000 (GMT) (envelope-from gcorcoran@rcn.com) Received: from mr02.lnh.mail.rcn.net ([207.172.157.22]) by smtp02.lnh.mail.rcn.net with ESMTP; 14 Sep 2006 14:07:07 -0400 Received: from smtp01.lnh.mail.rcn.net (smtp01.lnh.mail.rcn.net [207.172.4.11]) by mr02.lnh.mail.rcn.net (MOS 3.7.5a-GA) with ESMTP id MFW36151; Thu, 14 Sep 2006 14:07:05 -0400 (EDT) Received: from 207-172-55-230.c3-0.tlg-ubr5.atw-tlg.pa.cable.rcn.com (HELO [10.56.78.130]) ([207.172.55.230]) by smtp01.lnh.mail.rcn.net with ESMTP; 14 Sep 2006 14:07:05 -0400 X-IronPort-AV: i="4.09,165,1157342400"; d="scan'208"; a="276724535:sNHT25546684" Message-ID: <45099BE3.6080902@rcn.com> Date: Thu, 14 Sep 2006 14:13:55 -0400 From: Gary Corcoran User-Agent: Thunderbird 1.5.0.5 (Windows/20060719) MIME-Version: 1.0 To: Mike Meyer References: <863bauk3gp.fsf@dwp.des.no> <45099123.4000500@rcn.com> <17673.37830.1883.272019@bhuda.mired.org> In-Reply-To: <17673.37830.1883.272019@bhuda.mired.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Junkmail: UCE(50) X-Junkmail-Status: score=50/50, host=mr02.lnh.mail.rcn.net X-Junkmail-SD-Raw: score=bulk(0), refid=str=0001.0A090201.4509988D.007B,ss=3,fgs=0, ip=207.172.4.11, so=2006-05-09 23:27:51, dmn=5.2.113/2006-07-26 Cc: freebsd-hackers@freebsd.org Subject: Re: numbers don't lie ... X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Sep 2006 18:07:08 -0000 Mike Meyer wrote: > In <45099123.4000500@rcn.com>, Gary Corcoran typed: >> The confusing thing is that I thought 'real' time should be >= 'user' + 'sys'. >> But here 'user' is much greater than 'real' for both machines! The sense I >> got from the other messages in this thread is that 'user' time is somewhat >> meaningless (i.e. unreliable as a measure) in a multi-CPU and/or hyperthreading >> environment. Can you clarify? > > 'real' is wall clock time. 'user' and 'sys' are cpu time. If your > process gets all of some cpu, then user + sys will be the same as real > time. It's not possible to get more than all of a cpu, so that's a > maximum *per cpu*. If you have multiple cpus, the formula you want is > 'real' * ncpu >= 'user' + 'sys'. Thanks to all of you for the responses. The thing that was not clear is that despite the printed messages, user (and sys) time are *not* measures of time. IMO it would be much easier to understand if the message said that they were so-many cpu-seconds, rather than just seconds. Then it would be fairly obvious that in a multiprocessor environment that the real time could be less than the sum of user + sys. I know, once you understand the true meaning of user/sys time it's "obvious", but not to the first-time multiprocessor observer... :-) > I made the comment about freebsd's measure of user time being skewed > by hyperthreading. That's a bit vague. The problem is that waiting > caused by hyperthreading will count against the instruction that's > doing the waiting, which skews them. But as Kris pointed out, there > are other things that have that property, so this is just one more > complication when it comes to figuring the performance of modern CPUs. ;-) Thanks, Gary