From owner-svn-src-head@FreeBSD.ORG Mon Oct 27 20:10:40 2008 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AB2201065675; Mon, 27 Oct 2008 20:10:40 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from sippysoft.com (gk1.360sip.com [72.236.70.240]) by mx1.freebsd.org (Postfix) with ESMTP id 737898FC24; Mon, 27 Oct 2008 20:10:40 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from [192.168.1.23] (S0106001372fd1e07.vs.shawcable.net [70.71.2.169]) (authenticated bits=0) by sippysoft.com (8.13.8/8.13.8) with ESMTP id m9RJaMtc043601 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 27 Oct 2008 12:36:22 -0700 (PDT) (envelope-from sobomax@FreeBSD.org) Message-ID: <4906185C.1010900@FreeBSD.org> Date: Mon, 27 Oct 2008 12:37:00 -0700 From: Maxim Sobolev Organization: Sippy Software, Inc. User-Agent: Thunderbird 2.0.0.17 (Windows/20080914) MIME-Version: 1.0 To: John Baldwin References: <200810261858.m9QIw4YV091893@svn.freebsd.org> <200810271411.11813.jhb@freebsd.org> In-Reply-To: <200810271411.11813.jhb@freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r184293 - in head/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Oct 2008 20:10:40 -0000 John Baldwin wrote: > On Sunday 26 October 2008 02:58:04 pm Maxim Sobolev wrote: >> Author: sobomax >> Date: Sun Oct 26 18:58:04 2008 >> New Revision: 184293 >> URL: http://svn.freebsd.org/changeset/base/184293 >> >> Log: >> Fix division by zero panic if kern.hz less than 32. >> >> MFC after: 1 day > > This is wrong. In the case you are worried about here, lapic_timer_hz is less > than 128. There is no way you are going to fire stathz 128 times per second > from a timer running at < 128 hz. You are effectively running stathz at > lapic_timer_hz, so I would just set stathz = lapic_timer_hz in this case. > Also, I would drop the extra {}'s to match style(9) as well as the existing > style of the file. It might be wrong, but it's better than division by zero panic. And it actually works, check this screenshot: http://sobomax.sippysoft.com/~sobomax/ScreenShot362.png [ssp-root@sippy ~]$ sysctl -a | grep hz kern.clockrate: { hz = 10, tick = 100000, profhz = 40, stathz = 128 } As for the style(9), I am not really sure that applies, the exact quote: Space after keywords (if, while, for, return, switch). No braces (`{' and `}') are used for control statements with zero or only a single statement unless that statement is more than a single line in which case they are permitted. Forever loops are done with for's, not while's. To me the following if: if () stmt1; else stmt2; falls into the category of statements with more than single line (3 in this case), so that {} is appropriate. So that either my change is OK, or style(9) needs to be clarified to include if/else explicitly. -Maxim