From owner-svn-src-head@FreeBSD.ORG Mon Oct 27 19:21:26 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 3BA40106566B; Mon, 27 Oct 2008 19:21:26 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id B20608FC13; Mon, 27 Oct 2008 19:21:25 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from localhost.corp.yahoo.com (john@localhost [IPv6:::1]) (authenticated bits=0) by server.baldwin.cx (8.14.3/8.14.3) with ESMTP id m9RJLJMO014395; Mon, 27 Oct 2008 15:21:19 -0400 (EDT) (envelope-from jhb@freebsd.org) From: John Baldwin To: Maxim Sobolev Date: Mon, 27 Oct 2008 14:11:11 -0400 User-Agent: KMail/1.9.7 References: <200810261858.m9QIw4YV091893@svn.freebsd.org> In-Reply-To: <200810261858.m9QIw4YV091893@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200810271411.11813.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [IPv6:::1]); Mon, 27 Oct 2008 15:21:19 -0400 (EDT) X-Virus-Scanned: ClamAV 0.93.1/8511/Mon Oct 27 14:23:52 2008 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=4.2 tests=BAYES_00,NO_RELAYS autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx 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 19:21:26 -0000 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. > Modified: > head/sys/amd64/amd64/local_apic.c > head/sys/i386/i386/local_apic.c > > Modified: head/sys/amd64/amd64/local_apic.c > ============================================================================== > --- head/sys/amd64/amd64/local_apic.c Sun Oct 26 17:20:37 2008 (r184292) > +++ head/sys/amd64/amd64/local_apic.c Sun Oct 26 18:58:04 2008 (r184293) > @@ -401,7 +401,11 @@ lapic_setup_clock(void) > lapic_timer_hz = hz * 2; > else > lapic_timer_hz = hz * 4; > - stathz = lapic_timer_hz / (lapic_timer_hz / 128); > + if (lapic_timer_hz < 128) { > + stathz = 128; > + } else { > + stathz = lapic_timer_hz / (lapic_timer_hz / 128); > + } > profhz = lapic_timer_hz; > lapic_timer_period = value / lapic_timer_hz; -- John Baldwin