Date: Wed, 29 Oct 2008 21:12:19 +0000 (UTC) From: Maxim Sobolev <sobomax@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org Subject: svn commit: r184455 - in stable/6/sys: . amd64/amd64 i386/i386 Message-ID: <200810292112.m9TLCJ9I033234@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: sobomax Date: Wed Oct 29 21:12:19 2008 New Revision: 184455 URL: http://svn.freebsd.org/changeset/base/184455 Log: MFC: don't panic when HZ value is below 32. This change may need a bit of refinement later, as bde says that 4BSD expects stathz of 128, while in this case stathz would be in the range 40-128. Approved by: re (kib, kensmith) Modified: stable/6/sys/ (props changed) stable/6/sys/amd64/amd64/local_apic.c stable/6/sys/i386/i386/local_apic.c Modified: stable/6/sys/amd64/amd64/local_apic.c ============================================================================== --- stable/6/sys/amd64/amd64/local_apic.c Wed Oct 29 21:08:34 2008 (r184454) +++ stable/6/sys/amd64/amd64/local_apic.c Wed Oct 29 21:12:19 2008 (r184455) @@ -392,7 +392,10 @@ 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 = lapic_timer_hz; + else + stathz = lapic_timer_hz / (lapic_timer_hz / 128); profhz = lapic_timer_hz; lapic_timer_period = value / lapic_timer_hz; Modified: stable/6/sys/i386/i386/local_apic.c ============================================================================== --- stable/6/sys/i386/i386/local_apic.c Wed Oct 29 21:08:34 2008 (r184454) +++ stable/6/sys/i386/i386/local_apic.c Wed Oct 29 21:12:19 2008 (r184455) @@ -393,7 +393,10 @@ 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 = lapic_timer_hz; + else + stathz = lapic_timer_hz / (lapic_timer_hz / 128); profhz = lapic_timer_hz; lapic_timer_period = value / lapic_timer_hz;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200810292112.m9TLCJ9I033234>