From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 20 22:40:54 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 9CC3616A400; Thu, 20 Apr 2006 22:40:54 +0000 (UTC) (envelope-from marco@goofy.tols.org) Received: from goofy.tols.org (goofy.demon.nl [83.160.134.92]) by mx1.FreeBSD.org (Postfix) with ESMTP id 13CC243D46; Thu, 20 Apr 2006 22:40:53 +0000 (GMT) (envelope-from marco@goofy.tols.org) Received: from goofy.tols.org (localhost [127.0.0.1]) by goofy.tols.org (8.13.4/8.13.4) with ESMTP id k3KMenFN099465; Thu, 20 Apr 2006 22:40:49 GMT (envelope-from marco@goofy.tols.org) Received: (from marco@localhost) by goofy.tols.org (8.13.4/8.13.4/Submit) id k3KMenj6099464; Fri, 21 Apr 2006 00:40:49 +0200 (CEST) (envelope-from marco) Date: Fri, 21 Apr 2006 00:40:49 +0200 From: Marco van Tol To: freebsd-hackers@freebsd.org Message-ID: <20060420224049.GA99399@tols.org> Mail-Followup-To: freebsd-hackers@freebsd.org, John Baldwin References: <20060412215021.GB1146@tols.org> <20060417134825.GA47043@tols.org> <20060418221505.GC58081@tols.org> <200604181838.27713.jhb@freebsd.org> <20060419072627.GA66012@tols.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20060419072627.GA66012@tols.org> User-Agent: Mutt/1.4.2.1i X-Virus-Scanned: ClamAV 0.88.1/1410/Thu Apr 20 17:49:52 2006 on goofy.tols.org X-Virus-Status: Clean X-Spam-Status: No, score=-4.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.0 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on goofy.tols.org Cc: Subject: Re: Per CPU cpu-statistics under SMP 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, 20 Apr 2006 22:40:54 -0000 On Wed, Apr 19, 2006 at 07:26:27AM +0000, Marco van Tol wrote: > On Tue, Apr 18, 2006 at 06:38:26PM -0400, John Baldwin wrote: [...] > > Ah, hmm. On 6.x we don't have per-thread stat ticks yet, which is > > probably why it is failing. It also isn't safe to move sched_lock > > down either on 6.x. You can still apply the rest of the patch by > > hand, just leave the 'mtx_lock_spin(&sched_lock)' where it is and > > change all the 'cp_time[FOO]++' to 'PCPU_LAZY_INC(cp_time[FOO])'. > > OK, thanks. > > What I will do is replace my gentoo partition with a BSD current partition > so I don't loose my workstation as it were, and use that to work on this. > > Will let you know how that goes. Thanks. Ha! It succeeded. :) For additional information: - I'm running an Athlon64 X2 4200+ in 64bit mode. (I won't start about the nvidia controller it also has ;) - I'm using the SCHED_ULE scheduler (Does that make a difference for this?) - All patching took place against todays CURRENT. - I manually patched the first hunk of kern_clock.c, as the rest of the hunks succeeded on their own. (Hadn't used .rej files much before, but they're very usefull :) Thank you very much! I think this should suffice for what I intend to do to gkrellm for now. If you want any additional information from me, or if you want me to test other patches, I'd be more then happy to supply/try it/them. Here's the result: -----< cut here >----- 1:0[marco@donald marco]sysctl hw.ncpu hw.ncpu: 2 -----< cut here >----- 1:0[marco@donald marco]for (( i = 0 ; $i < 10 ; i++ )) ; do sysctl kern.pcpu_time kern.cp_time ; sleep 1 ; echo -- ; done kern.pcpu_time: 156 0 397 225 20542 21 0 30 0 21259 kern.cp_time: 177 0 427 225 41801 -- kern.pcpu_time: 156 0 397 225 20675 21 0 30 0 21392 kern.cp_time: 177 0 427 225 42067 -- kern.pcpu_time: 157 0 398 225 20807 21 0 30 0 21526 kern.cp_time: 178 0 428 225 42333 -- kern.pcpu_time: 157 0 398 225 20940 21 0 30 0 21659 kern.cp_time: 178 0 428 225 42599 -- kern.pcpu_time: 157 0 398 225 21074 21 0 30 0 21793 kern.cp_time: 178 0 428 225 42867 -- kern.pcpu_time: 157 0 398 225 21207 21 0 30 0 21926 kern.cp_time: 178 0 428 225 43133 -- kern.pcpu_time: 157 0 398 225 21340 21 0 30 0 22059 kern.cp_time: 178 0 428 225 43399 -- kern.pcpu_time: 157 0 399 225 21473 21 0 30 0 22193 kern.cp_time: 178 0 429 225 43666 -- kern.pcpu_time: 157 0 399 225 21606 21 0 30 0 22326 kern.cp_time: 178 0 429 225 43932 -- kern.pcpu_time: 157 0 399 225 21740 21 0 30 0 22460 kern.cp_time: 178 0 429 225 44200 -- 0:0[marco@donald marco] -----< cut here >----- Marco -- The difference between theory and practice is a lot bigger in practice then in theory - Peter van der Linden in `Deep C Secrets'