lkml.org 
[lkml]   [2005]   [Jun]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: Accessing monotonic clock from modules
Date
> Arjan van de Ven wrote:
>> On Thu, 2005-06-02 at 07:46 -0600, Chris Friesen wrote:
>
>>>For ourselves we implemented an clock interface for a limited subset of
>>>architectures that provides a fast timestamp in kernel and userspace.
>>>
>>>Basically it has one call to return a 64-bit timestamp, and another call
>>>to tell you how fast the clock is ticking.
>>
>>
>> hmm this is tricky if cpufreq actually varies cpu speeds... you would
>> need to not cache the "how fast it ticks" for too long.
>
> Luckily we didn't need to deal with that.
>
> In order to use the fast versions with varying frequency you'd need some
> kind of notification to all users when the frequency changes.
>
> Alternately, on architectures where clock_gettime doesn't require the
> overhead of a syscall, you could just use that.

JACK also implements a fast high-res timer for each supported arch. We
can't use gettimeofday as it's about 50x slower than rdtsc (tested it just
now).

I suggested using the kernel events mechanism to notify userspace when
the CPU speed changes a few months ago, for this exact reason.

Lee

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-06-04 05:35    [W:0.104 / U:0.724 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site