Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 13 Jan 2000 22:48:11 GMT
From:      stenn@whimsy.udel.edu
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   kern/16113: STABLE kernel page fault changing the timer frequency
Message-ID:  <200001132248.WAA01548@howland.udel.edu>

next in thread | raw e-mail | index | archive | help


>Number:         16113
>Category:       kern
>Synopsis:       Kernel page fault panic using sysctl to change timer frequency
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jan 13 14:50:01 PST 2000
>Closed-Date:
>Last-Modified:
>Originator:     Harlan Stenn
>Release:        FreeBSD 3.4-20000105-STABLE i386
>Organization:
>Environment:

	3-STABLE (not 2-STABLE or -CURRENT)

>Description:

	Wrote a perl script to wiggle the timer frequency, based on ntpd's
	/etc/ntp.drift file and input from PHK.  It seems to work fine on
	2-STABLE and -CURRENT, but it panics a 3-STABLE kernel with a
	page fault.

>How-To-Repeat:

	Run ntpd long enough to get a valid /etc/ntp.drift file.
	Run the following script.

	#! /usr/bin/perl -w

	$driftfile = "/etc/ntp.drift";

	open(DF, $driftfile) || die "Can't open driftfile ($driftfile): $!\n";
	while(<DF>) {
	    chop;
	    if (/^-?\d+\.\d+$/) {
		$drift = $_;
	    } else {
		die "Bogus value in driftfile $driftfile: <$_>\n";
	    }
	}
	close(DF);

	print "drift is      <$drift>\n";

	$freq_adj = 1 - $drift / 1000000;

	print "freq_adj is <$freq_adj>\n";

	chop($i8254_freq = `sysctl -n machdep.i8254_freq`);
	chop($tsc_freq = `sysctl -n machdep.tsc_freq 2> /dev/null`);

	print "i8254_freq is <$i8254_freq>\n";
	print "tsc_freq is   <$tsc_freq>\n";

	if ($i8254_freq > 1) {
	    $i8254_freq = int $i8254_freq * $freq_adj;
	    print "i8254_freq -> <$i8254_freq>\n";
	    print "i8254: ".`sysctl -w machdep.i8254_freq=$i8254_freq`;
	}

	if ($tsc_freq > 1) {
	    $tsc_freq = int $tsc_freq * $freq_adj;
	    print "tsc_freq ->   <$tsc_freq>\n";
	    print "tsc: ".`sysctl -w machdep.tsc_freq=$tsc_freq`;
	}

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200001132248.WAA01548>