From owner-freebsd-alpha Tue Nov 12 9:14:31 2002 Delivered-To: freebsd-alpha@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C077D37B401; Tue, 12 Nov 2002 09:14:29 -0800 (PST) Received: from duke.cs.duke.edu (duke.cs.duke.edu [152.3.140.1]) by mx1.FreeBSD.org (Postfix) with ESMTP id E169A43E4A; Tue, 12 Nov 2002 09:14:28 -0800 (PST) (envelope-from gallatin@cs.duke.edu) Received: from grasshopper.cs.duke.edu (grasshopper.cs.duke.edu [152.3.145.30]) by duke.cs.duke.edu (8.9.3/8.9.3) with ESMTP id MAA17730; Tue, 12 Nov 2002 12:14:28 -0500 (EST) Received: (from gallatin@localhost) by grasshopper.cs.duke.edu (8.11.6/8.9.1) id gACHDwB49691; Tue, 12 Nov 2002 12:13:58 -0500 (EST) (envelope-from gallatin@cs.duke.edu) From: Andrew Gallatin MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15825.14038.294916.650698@grasshopper.cs.duke.edu> Date: Tue, 12 Nov 2002 12:13:58 -0500 (EST) To: "Dr. Michael Mackey" Cc: John Baldwin , freebsd-alpha@FreeBSD.ORG Subject: Re: Extreme time drift in SMP mode In-Reply-To: <15825.12436.199011.915697@grasshopper.cs.duke.edu> References: <3DD12AA2.8D84B3E2@engineering.uiowa.edu> <3DD12CE7.10103@spock.cl> <15825.12436.199011.915697@grasshopper.cs.duke.edu> X-Mailer: VM 6.75 under 21.1 (patch 12) "Channel Islands" XEmacs Lucid Sender: owner-freebsd-alpha@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Andrew Gallatin writes: > > Roberto de Iriarte writes: > > > Hmmm. my dmesg reads differently > > BTW, my system has only one CPU, and the clock has never drifted. > > > > That's the thing. The 2100 is unlike all other alphas, and handles > clocks differently in MP mode. To elaborate on the above, I think most MP alphas tie the clock interrupt to the boot cpu, and it ticks at hz. I think the 2100 round-robins the clock interrupt to all running cpus, therefore the boot cpu only ticks at hz/mp_ncpus. Currently, we pay attention only to the boot CPU. From alpha_clock_interrupt() in sys/alpha/alpha/interrupt.c <...> critical_enter(); #ifdef SMP /* * Only one processor drives the actual timer. */ if (PCPU_GET(cpuid) == boot_cpu_id) { #endif (*platform.clockintr)(framep); /* divide hz (1024) by 8 to get stathz (128) */ if ((++schedclk2 & 0x7) == 0) statclock((struct clockframe *)framep); #ifdef SMP } else { mtx_lock_spin(&sched_lock); hardclock_process(curthread, TRAPF_USERMODE(framep)); if ((schedclk2 & 0x7) == 0) statclock_process(curkse, TRAPF_PC(framep), TRAPF_USERMODE(framep)); mtx_unlock_spin(&sched_lock); } #endif critical_exit(); <...> Given that I know zippo about how timekeeping works, I don't know what a good fix might be. If I had a machine in front of me, I'd be tempted to try dividing the a frequency by 2 in sys/alpha/alpha/clock.c, but I'm not sure which one, or if it can be adjusted as additional processors are found and started. (which would be slightly less wrong..). Drew To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-alpha" in the body of the message