Date: Wed, 29 Oct 2008 21:08:34 +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-7@freebsd.org Subject: svn commit: r184454 - in stable/7/sys: . amd64/amd64 i386/i386 Message-ID: <200810292108.m9TL8YNR033085@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: sobomax Date: Wed Oct 29 21:08:34 2008 New Revision: 184454 URL: http://svn.freebsd.org/changeset/base/184454 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/7/sys/ (props changed) stable/7/sys/amd64/amd64/local_apic.c stable/7/sys/i386/i386/local_apic.c Modified: stable/7/sys/amd64/amd64/local_apic.c ============================================================================== --- stable/7/sys/amd64/amd64/local_apic.c Wed Oct 29 20:19:54 2008 (r184453) +++ stable/7/sys/amd64/amd64/local_apic.c Wed Oct 29 21:08:34 2008 (r184454) @@ -401,7 +401,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/7/sys/i386/i386/local_apic.c ============================================================================== --- stable/7/sys/i386/i386/local_apic.c Wed Oct 29 20:19:54 2008 (r184453) +++ stable/7/sys/i386/i386/local_apic.c Wed Oct 29 21:08:34 2008 (r184454) @@ -403,7 +403,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?200810292108.m9TL8YNR033085>