Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Global page into user processes (was: Re: Patch to cache TLS in %fp7 to avoid _lwp_getprivate syscalls)

On Wed, 18 Jan 2012 10:54:43 +0100
Joerg Sonnenberger <> wrote:

> On Wed, Jan 18, 2012 at 01:02:22AM -0500, Matthew Mondor wrote:
> > Since that doesn't already exist but appears at first glance rather
> > simple to implement, is there a particular reason that makes this
> > undesirable?
> On platforms with SMP support, it often requires per-CPU mappings. This
> makes context switching more expensive and/or costs memory. That doesn't
> apply for M68K though.

I noticed that the KERN_HARDCLOCK_TICKS sysctl(3) is still quite faster
than gettimeofday(2) (although it only exports a single int, the

# 1 million calls on a P4
behemoth$ time ./sysctl
        0.89 real         0.20 user         0.66 sys
behemoth$ time ./gettimeofday
        1.54 real         0.16 user         1.30 sys

Would it make more sense to export a higher resolution timestamp via
sysctl and have libc clock calls use that?  Any idea if sysctl also
suffers from the SMP related overhead already (and thus gives similar
performance to what a shared page would achieve)?

A part that's currently unclear to me is the impact of actively
updating a timeval regularily from the kernel, as currently
gettimeofday(2) results in on-demand calls microtime() which calls
bintime() which in turn calls binuptime(), which then gets the
information from timehands.  I guess that timehands is what would have
to get exported...


Home | Main Index | Thread Index | Old Index