From owner-freebsd-arch Sun Feb 17 12:32:16 2002 Delivered-To: freebsd-arch@freebsd.org Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by hub.freebsd.org (Postfix) with ESMTP id B85CF37B400; Sun, 17 Feb 2002 12:31:55 -0800 (PST) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.11.6/8.11.6) with ESMTP id g1HKSlN06010; Sun, 17 Feb 2002 21:28:47 +0100 (CET) (envelope-from phk@critter.freebsd.dk) To: Matthew Dillon Cc: Terry Lambert , Julian Elischer , Alfred Perlstein , arch@FreeBSD.ORG, jhb@FreeBSD.ORG, peter@wemm.org, jake@locore.ca Subject: Re: gettimeofday() and crhold()/crfree() (was Re: gettimeofday()and copyout(). Is copyout() MPSAFE on non-i386 archs? ) In-Reply-To: Your message of "Sun, 17 Feb 2002 12:11:54 PST." <200202172011.g1HKBsv88526@apollo.backplane.com> Date: Sun, 17 Feb 2002 21:28:47 +0100 Message-ID: <6008.1013977727@critter.freebsd.dk> From: Poul-Henning Kamp 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 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); >: >: struct kernstuff { >: u_int32_t version; >: pid_t pid, ppid; >: uid_t uid, euid ... >: gid_t gid, guid ... >: signal masks >: ... >: } >: >: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. 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. This was a design parameter for timecounters, I have just never gotten around to commit the stuff. It is an optimization which I think is not quite needed yet and I certainly have other things in my queue with higher priority right now. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message