[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <BANLkTin0gqQopry+nLDZX1DdQC9-c70nmA@mail.gmail.com>
Date: Thu, 19 May 2011 10:11:01 -0400
From: Andrew Lutomirski <luto@....edu>
To: Andi Kleen <andi@...stfloor.org>
Cc: x86@...nel.org, Ingo Molnar <mingo@...e.hu>,
Thomas Gleixner <tglx@...utronix.de>,
linux-kernel@...r.kernel.org,
Peter Zijlstra <a.p.zijlstra@...llo.nl>
Subject: Re: [PATCH] x86-64: Add time to vDSO
On Thu, May 19, 2011 at 9:53 AM, Andi Kleen <andi@...stfloor.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@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists