lkml.org 
[lkml]   [2011]   [May]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] x86-64: Add time to vDSO
On Thu, May 19, 2011 at 9:53 AM, Andi Kleen <andi@firstfloor.org> wrote:
> On Thu, May 19, 2011 at 09:24:48AM -0400, Andy Lutomirski wrote:
>> The only fast implementation of time(2) we expose is through the
>> vsyscall page and we want to get userspace to stop using the
>> vsyscall page.  So make it available through the vDSO as well.
>
> User space can just use vgettimeofday() and only take the seconds.
> Adding time() too was a mistake back then.
>
> And BTW just for seconds alone you wouldn't need the seqlock.

True. I just copied this from the vsyscall code. I can optimize it,
but maybe that should be a followup patch. I'd rather not duplicate
code like this, but that would need some additional infrastructure.

Note that this is five times as fast as vgettimeofday on Sandy Bridge
with my patches. Without the patches it's seven times as fast, and on
older machines it's more like 100 times faster. I'm not sure that
having glibc use CLOCK_REALTIME_COARSE is a good idea -- some day we
might want to get rid of the periodic tick even under load and then
time() should do something clever.

--Andy

>
> -Andi
>
--
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: 2011-05-19 16:13    [W:0.050 / U:0.188 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site