From owner-freebsd-arch Fri Nov 17 2:56:19 2000 Delivered-To: freebsd-arch@freebsd.org Received: from zibbi.icomtek.csir.co.za (zibbi.icomtek.csir.co.za [146.64.24.58]) by hub.freebsd.org (Postfix) with ESMTP id BF1C637B479 for ; Fri, 17 Nov 2000 02:55:50 -0800 (PST) Received: (from jhay@localhost) by zibbi.icomtek.csir.co.za (8.11.0/8.11.0) id eAHArq488675; Fri, 17 Nov 2000 12:53:52 +0200 (SAT) (envelope-from jhay) From: John Hay Message-Id: <200011171053.eAHArq488675@zibbi.icomtek.csir.co.za> Subject: Re: new monotime() call for all architectures. In-Reply-To: <200011170655.eAH6tCJ05746@gratis.grondar.za> from Mark Murray at "Nov 17, 2000 08:55:04 am" To: mark@grondar.za (Mark Murray) Date: Fri, 17 Nov 2000 12:53:52 +0200 (SAT) Cc: arch@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL54 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > > I need a fast-as-possible "time" inside the kernel to help > speed up the /dev/random device. I say "time", because although > it needs to be a function of time (preferably accurate and linear), > it has no need whatsoever to be "real time", so a simple counter > is quite OK. > > Pentiums, Alphas and IA64's all have a suitable register on chip, > while I have to make do with nanotime(9) on i386 and i486. > > I have prepared a monotime(9) call for the i386, alpha and ia64 > architectures (patch enclosed). I have been running this for a > week or two now with promising results (on a Pentium). With > the exception of the minimum of "glue" (and nanotime on older > architectures), these functions reduce to one instruction. > Are you sure it will work on SMP machines? There is nothing that synchronizes the onboard counters. Or will your code stay on one cpu? John -- John Hay -- John.Hay@icomtek.csir.co.za To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message