Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 18 Feb 2002 11:32:19 +1100 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        Poul-Henning Kamp <phk@critter.freebsd.dk>
Cc:        Matthew Dillon <dillon@apollo.backplane.com>, Terry Lambert <tlambert2@mindspring.com>, Julian Elischer <julian@elischer.org>, Alfred Perlstein <bright@mu.org>, <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? ) 
Message-ID:  <20020218112751.T3970-100000@gamplex.bde.org>
In-Reply-To: <6008.1013977727@critter.freebsd.dk>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020218112751.T3970-100000>