From owner-p4-projects Wed Jan 1 14: 3:53 2003 Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id B581837B405; Wed, 1 Jan 2003 14:03:50 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4860D37B401 for ; Wed, 1 Jan 2003 14:03:50 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id D638643EB2 for ; Wed, 1 Jan 2003 14:03:49 -0800 (PST) (envelope-from marcel@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h01M3nfh028014 for ; Wed, 1 Jan 2003 14:03:49 -0800 (PST) (envelope-from marcel@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h01M3nKH028011 for perforce@freebsd.org; Wed, 1 Jan 2003 14:03:49 -0800 (PST) Date: Wed, 1 Jan 2003 14:03:49 -0800 (PST) Message-Id: <200301012203.h01M3nKH028011@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to marcel@freebsd.org using -f From: Marcel Moolenaar Subject: PERFORCE change 23029 for review To: Perforce Change Reviews Sender: owner-p4-projects@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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