Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 1 Jan 2003 14:03:49 -0800 (PST)
From:      Marcel Moolenaar <marcel@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 23029 for review
Message-ID:  <200301012203.h01M3nKH028011@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=23029

Change 23029 by marcel@marcel_nfs on 2003/01/01 14:03:34

	Manually inline handleclock() at the one and only call-site.
	Remove handleclock().
	While here, reload cr.itm (interval timer match register)
	based on the old value of cr.itm and not cr.itc (interval
	timer counter). The value of cr.itc is non-deterministicly
	close to the value of cr.itm at the time of the interrupt.
	The SDM clearly states that they are not guaranteed to be
	identical, even though the interrupt is triggered when
	cr.itc equals cr.itm). Reloading cr.itm based on the value
	of cr.itc will therefore introduce a non-deterministic error
	in the clocks. This will also reduce clock skew due to
	interrupt latency.

Affected files ...

.. //depot/projects/ia64/sys/ia64/ia64/clock.c#13 edit
.. //depot/projects/ia64/sys/ia64/ia64/interrupt.c#21 edit
.. //depot/projects/ia64/sys/ia64/include/clock.h#6 edit

Differences ...

==== //depot/projects/ia64/sys/ia64/ia64/clock.c#13 (text+ko) ====

@@ -254,13 +254,6 @@
 }
 #endif
 
-void
-handleclock(void* arg)
-{
-	ia64_set_itm(ia64_get_itc() + (itc_frequency + hz/2) / hz);
-	hardclock(arg);
-}
-
 /*
  * We assume newhz is either stathz or profhz, and that neither will
  * change after being set up above.  Could recalculate intervals here

==== //depot/projects/ia64/sys/ia64/ia64/interrupt.c#21 (text+ko) ====

@@ -128,13 +128,14 @@
 		/* Only the BSP runs the real clock */
 		if (PCPU_GET(cpuid) == 0) {
 #endif
-			handleclock(framep);
+			ia64_set_itm(ia64_get_itm() + itm_reload);
+			hardclock((struct clockframe *)framep);
 			/* divide hz (1024) by 8 to get stathz (128) */
 			if ((++schedclk2 & 0x7) == 0)
 				statclock((struct clockframe *)framep);
 #ifdef SMP
 		} else {
-			ia64_set_itm(ia64_get_itc() + itm_reload);
+			ia64_set_itm(ia64_get_itm() + itm_reload);
 			mtx_lock_spin(&sched_lock);
 			hardclock_process(curthread, TRAPF_USERMODE(framep));
 			if ((schedclk2 & 0x7) == 0)

==== //depot/projects/ia64/sys/ia64/include/clock.h#6 (text+ko) ====

@@ -23,7 +23,6 @@
 int	sysbeep(int pitch, int period);
 int	acquire_timer2(int mode);
 int	release_timer2(void);
-void	handleclock(void *arg);
 
 #endif
 

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




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