From owner-freebsd-current@FreeBSD.ORG Tue Jul 15 19:17:57 2008 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0F7361065670 for ; Tue, 15 Jul 2008 19:17:57 +0000 (UTC) (envelope-from yanefbsd@gmail.com) Received: from wf-out-1314.google.com (wf-out-1314.google.com [209.85.200.172]) by mx1.freebsd.org (Postfix) with ESMTP id D19FB8FC20 for ; Tue, 15 Jul 2008 19:17:56 +0000 (UTC) (envelope-from yanefbsd@gmail.com) Received: by wf-out-1314.google.com with SMTP id 24so4384578wfg.7 for ; Tue, 15 Jul 2008 12:17:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:cc:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=60tZa3Rzwg0qhwV25u6M5IQ9ACUzBWG6OtYquk5xc0o=; b=A1ljJCRAKm2BqZ13AfjL8NmCqYklvewK/YZOfmusCote/sOlrQBLbpXIOQs7PqvOJD oLwTqMhOdmg6HB0J0SIzkVIgIibk995ByUSvo84eIXkCfzwxe9EjCIZ2Gf/20MRdZ1ak PhbSy9uJjWRPcpYxa7PjZNzQTj66KkycoVe8E= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=cc:message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=mU6S22t6lpKP/NzX0t2iJagxd5kJjc8YKCI8cBLx9ICMYz9RBTIAMKUsRIfnCmFikH 2FkqNQRoINp+eQKCV8Y1FN+6u+9vdU6edTXcJ1Lw936wJC0DExjEscLe2zBHa+4kY3LX ZrV9zuGqe6L17RknTrw+lU0ZBJrJlZEiExvxg= Received: by 10.142.72.4 with SMTP id u4mr4798271wfa.269.1216149476459; Tue, 15 Jul 2008 12:17:56 -0700 (PDT) Received: from ?192.168.10.42? ( [76.254.4.131]) by mx.google.com with ESMTPS id 32sm6225997wfc.12.2008.07.15.12.17.54 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 15 Jul 2008 12:17:55 -0700 (PDT) Message-Id: From: Garrett Cooper To: Steve Kargl In-Reply-To: <20080715183509.GA81210@troutmask.apl.washington.edu> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v926) Date: Tue, 15 Jul 2008 12:15:21 -0700 References: <20080715175944.GA80901@troutmask.apl.washington.edu> <487CE839.3080507@math.missouri.edu> <20080715183509.GA81210@troutmask.apl.washington.edu> X-Mailer: Apple Mail (2.926) Cc: Stephen Montgomery-Smith , freebsd-current@freebsd.org Subject: Re: ULE scheduling oddity X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jul 2008 19:17:57 -0000 On Jul 15, 2008, at 11:35 AM, Steve Kargl wrote: > On Tue, Jul 15, 2008 at 01:11:05PM -0500, Stephen Montgomery-Smith > wrote: >> Steve Kargl wrote: >>> >>> PID USERNAME THR PRI NICE SIZE RES STATE C TIME WCPU >>> COMMAND >>> 3836 kargl 1 118 0 577M 572M CPU7 7 6:37 >>> 100.00% kzk90 >>> 3839 kargl 1 118 0 577M 572M CPU2 2 6:36 >>> 100.00% kzk90 >>> 3849 kargl 1 118 0 577M 572M CPU3 3 6:33 >>> 100.00% kzk90 >>> 3852 kargl 1 118 0 577M 572M CPU0 0 6:25 >>> 100.00% kzk90 >>> 3864 kargl 1 118 0 577M 572M RUN 1 6:24 >>> 100.00% kzk90 >>> 3858 kargl 1 112 0 577M 572M RUN 5 4:10 78.47% >>> kzk90 >>> 3855 kargl 1 110 0 577M 572M CPU5 5 4:29 67.97% >>> kzk90 >>> 3842 kargl 1 110 0 577M 572M CPU4 4 4:24 66.70% >>> kzk90 >>> 3846 kargl 1 107 0 577M 572M RUN 6 3:22 53.96% >>> kzk90 >>> 3861 kargl 1 107 0 577M 572M CPU6 6 3:15 53.37% >>> kzk90 >> >> My personal experience is that WCPU is not that accurate a measure of >> what is really going on. It is some kind of weighted CPU time, and >> according to the man page you have to wait for up to a minute to >> get an >> accurate sense. > > WCPU may indeed be misleading, but there appears to be a problem > with migrating a process to an otherwise idle cpu. If I kill > the process on CPU0 and one of the processes on CPU6, I then see > > last pid: 65293; load averages: 8.00, 8.33, 8.91 up > 19+21:43:26 11:14:21 > 39 processes: 9 running, 30 sleeping > CPU: 87.5% user, 0.0% nice, 0.0% system, 0.0% interrupt, 12.5% idle > Mem: 4569M Active, 64M Inact, 163M Wired, 304K Cache, 202M Buf, 26G > Free > Swap: 4096M Total, 4096M Free > > PID USERNAME THR PRI NICE SIZE RES STATE C TIME WCPU > COMMAND > 65035 kargl 1 118 0 577M 572M CPU7 7 62:15 100.00% > kzk90 > 65038 kargl 1 118 0 577M 572M CPU3 3 62:11 100.00% > kzk90 > 65023 kargl 1 118 0 577M 572M CPU1 1 58:44 100.00% > kzk90 > 65032 kargl 1 118 0 577M 572M CPU6 6 55:36 100.00% > kzk90 > 65026 kargl 1 118 0 577M 572M CPU2 2 53:32 100.00% > kzk90 > 65029 kargl 1 112 0 577M 572M CPU5 5 42:16 73.29% > kzk90 > 65041 kargl 1 110 0 577M 572M RUN 5 41:37 66.80% > kzk90 > 65020 kargl 1 110 0 577M 572M CPU4 4 43:45 64.36% > kzk90 > > The 3 processes with less than 100% WCPU bounce between CPU4 and CPU5. > Nothing is ever scheduled for CPU0. > >> What I tend to do is to look at the TIME's, and see how fast they >> tick. >> >> Also, you can run the programs thus: >> >> time ./kargl >> >> and the times produced at the end tend to be a rather good measure of >> actual percentage cpu time. Although I can see that in your >> situation >> that this might be tricky to use. > > I'd expect the output from time to be nearly identical for > each process in that each is running with the exact same > input parameters. > >> There is also a -C option with top that gives "raw CPU" time. I have >> never tried it, so I cannot speak to how good it really is. > > -C doesn't appear to give anything different. FWIW it appears that OSX has migrated away from traditional [n?]top available in FreeBSD and they no longer include WCPU. Maybe there were some other improvements made, because it consistently appears to be reporting the correct CPU usage percentage... Cheers, -Garrett