From owner-freebsd-current@FreeBSD.ORG Thu Apr 27 15:59:38 2006 Return-Path: X-Original-To: freebsd-current@FreeBSD.org Delivered-To: freebsd-current@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 47A3C16A403; Thu, 27 Apr 2006 15:59:38 +0000 (UTC) (envelope-from jmg@hydrogen.funkthat.com) Received: from hydrogen.funkthat.com (gate.funkthat.com [69.17.45.168]) by mx1.FreeBSD.org (Postfix) with ESMTP id D279D43D4C; Thu, 27 Apr 2006 15:59:37 +0000 (GMT) (envelope-from jmg@hydrogen.funkthat.com) Received: from hydrogen.funkthat.com (bijvaj27n32o618y@localhost.funkthat.com [127.0.0.1]) by hydrogen.funkthat.com (8.13.4/8.13.3) with ESMTP id k3RFxadp033218; Thu, 27 Apr 2006 08:59:36 -0700 (PDT) (envelope-from jmg@hydrogen.funkthat.com) Received: (from jmg@localhost) by hydrogen.funkthat.com (8.13.4/8.13.3/Submit) id k3RFxaR0033214; Thu, 27 Apr 2006 08:59:36 -0700 (PDT) (envelope-from jmg) Date: Thu, 27 Apr 2006 08:59:36 -0700 From: John-Mark Gurney To: Giorgos Keramidas Message-ID: <20060427155936.GH728@funkthat.com> Mail-Followup-To: Giorgos Keramidas , Jiawei Ye , freebsd-current@FreeBSD.org References: <20060427141318.GA74140@gothmog.pc> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20060427141318.GA74140@gothmog.pc> User-Agent: Mutt/1.4.2.1i X-Operating-System: FreeBSD 5.4-RELEASE-p6 i386 X-PGP-Fingerprint: B7 EC EF F8 AE ED A7 31 96 7A 22 B3 D8 56 36 F4 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html Cc: freebsd-current@FreeBSD.org, Jiawei Ye Subject: Re: top(1) stopped working on -current X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: John-Mark Gurney List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Apr 2006 15:59:38 -0000 Giorgos Keramidas wrote this message on Thu, Apr 27, 2006 at 17:13 +0300: > On 2006-04-27 14:42, Jiawei Ye wrote: > > leafy@chihiro:~$ top > > top: sysctl(kern.ccpu...) failed: No such file or directory > > > > -current as of 4 hrs ago. > > The following change renames `kern.ccpu' to `kern.sched.ccpu', but it is > kind of incomplete, IMHO. I'll get to this in a few hours.... sorry for the breakage... :( /me just woke up. > # Index: src/sys/kern/sched_4bsd.c > # =================================================================== > # --- src/sys/kern/sched_4bsd.c (revision 19) > # +++ src/sys/kern/sched_4bsd.c (working copy) > # @@ -31,11 +31,11 @@ > # * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > # * SUCH DAMAGE. > # */ > # > # #include > # -__FBSDID("$FreeBSD: src/sys/kern/sched_4bsd.c,v 1.78 2006/04/17 18:20:37 jhb Exp $"); > # +__FBSDID("$FreeBSD: src/sys/kern/sched_4bsd.c,v 1.79 2006/04/26 19:42:38 jmg Exp $"); > # > # #include "opt_hwpmc_hooks.h" > # > # #define kse td_sched > # > # @@ -404,11 +404,11 @@ > # #define loadfactor(loadav) (2 * (loadav)) > # #define decay_cpu(loadfac, cpu) (((loadfac) * (cpu)) / ((loadfac) + FSCALE)) > # > # /* decay 95% of `ke_pctcpu' in 60 seconds; see CCPU_SHIFT before changing */ > # static fixpt_t ccpu = 0.95122942450071400909 * FSCALE; /* exp(-1/20) */ > # -SYSCTL_INT(_kern, OID_AUTO, ccpu, CTLFLAG_RD, &ccpu, 0, ""); > # +SYSCTL_INT(_kern_sched, OID_AUTO, ccpu, CTLFLAG_RD, &ccpu, 0, ""); > # > # /* > # * If `ccpu' is not equal to `exp(-1/20)' and you still want to use the > # * faster/more-accurate formula, you'll have to estimate CCPU_SHIFT below > # * and possibly adjust FSHIFT in "param.h" so that (FSHIFT >= CCPU_SHIFT). > > The main problems with this change are: > > 1) It doesn't update consumers of the kern.ccpu sysctl that we > already have in the tree (i.e. top(1) which you saw breaking). > > 2) It doesn't update the `kern.ccpu' sysctl in the sched_ule.c > scheduler, so it creates an inconsistency between different > FreeBSD scheduling systems. > > I believe John-Mark can fix this easily, so I've copied him in this > message. In the mean time, you can revert sched_4bsd.c to revision 1.78 > and try to see if this fixes the problems top(1) is having. -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not."