From owner-freebsd-arch Sun Feb 17 16:32:40 2002 Delivered-To: freebsd-arch@freebsd.org Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by hub.freebsd.org (Postfix) with ESMTP id 4F3E237B404; Sun, 17 Feb 2002 16:32:36 -0800 (PST) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id LAA10351; Mon, 18 Feb 2002 11:32:20 +1100 Date: Mon, 18 Feb 2002 11:32:19 +1100 (EST) From: Bruce Evans X-X-Sender: To: Poul-Henning Kamp Cc: Matthew Dillon , Terry Lambert , Julian Elischer , Alfred Perlstein , , , , Subject: Re: gettimeofday() and crhold()/crfree() (was Re: gettimeofday()and copyout(). Is copyout() MPSAFE on non-i386 archs? ) In-Reply-To: <6008.1013977727@critter.freebsd.dk> Message-ID: <20020218112751.T3970-100000@gamplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Sun, 17 Feb 2002, Poul-Henning Kamp wrote: > In message <200202172011.g1HKBsv88526@apollo.backplane.com>, Matthew Dillon wri > tes: > >:Peter and I actually had a sligthly different idea: > >: > >:Add a new syscall: > >: > >: int getkernstuff(struct kernstuff *kp); > >:... > >:The idea here being that the userland process registers a single > >:static structure with the kernel. Inside libc, this structure > >:can be used to speed up signal processing and much more. > > > > This would make time-of-day updates rather costly. > > The above was not meant for time-of-day stuff but for all the > "per process" stuff, in particular signal masks. I think the synchronization costs for this would be high. > If we want to do fancy timekeeping, I have/had a patch which put > the timecounters on a single page which a process could map (hacked > with a special device driver). Provided that the process has acccess > to reading the timecounter (== not i8254) all the time-calculations > can be done in userland without any calls into the kernel. I know the synchronization costs for this would be high. They are too high even in the kernel, so we skip them for the get*time() family, at the cost of getting unsynchronised times. This may be acceptable in some applications. The read-only variable in kernel memory has similar synchronisation problems. It corresponds fairly directly with the variable read by the get*time() family. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message