public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Suleiman Souhlal <ssouhlal@FreeBSD.org>
To: Andi Kleen <ak@suse.de>
Cc: Linux Kernel ML <linux-kernel@vger.kernel.org>,
	vojtech@suse.cz, Jiri Bohac <jbohac@suse.cz>
Subject: Re: [PATCH 0/2] Make the TSC safe to be used by gettimeofday().
Date: Mon, 13 Nov 2006 18:06:15 -0800	[thread overview]
Message-ID: <45592497.1080109@FreeBSD.org> (raw)
In-Reply-To: <200611140250.57160.ak@suse.de>

Andi Kleen wrote:
> On Tuesday 14 November 2006 02:06, Suleiman Souhlal wrote:
> 
>>I've had a proof-of-concept for this since August, and finally got around to
>>somewhat cleaning it up.
> 
> 
> Thanks. 
> 
> I got a competing implementation for this unfortunately now from Vojtech & Jiri
> 
> Yours is simpler, but I'm not sure as complete. What are your assurances
> against non monoticity for example?

I believe that the results returned will always be monotonic, as long as 
the frequency of the TSC does not change from under us (that is, without 
the kernel knowing). This is because we "synchronize" each CPU's vxtime 
with a global time source (HPET) every time we know the TSC rate changes.

>>It can certainly still be improved, namely by using vgetcpu() instead of CPUID
>>to find the cpu number (but I couldn't get it to work, when I tried).
> 
> 
> What did not work?

I was not able to make vgettimeofday use vgetcpu(). It seemed like vgetcpu()
was not returning the same value as smp_processor_id() would, so the 
values I'd get with vgettimeofday() did not completely agree with the 
ones from gettimeofday(2). I didn't have the chance to investigate more.

>>Another possible improvement would be to use RDTSCP when available.
>>There's also a small race in do_gettimeofday(), vgettimeofday() and
>>vmonotonic_clock() but I've never seen it happen.
> 
> 
> I did a vposix_getclock with monotonic clock support on my own already, was about to 
> be merged with the vDSO. It still used global synchronized TSC though.

-- Suleiman


  reply	other threads:[~2006-11-14  2:06 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-14  1:06 [PATCH 0/2] Make the TSC safe to be used by gettimeofday() Suleiman Souhlal
2006-11-14  1:08 ` [PATCH 1/2] " Suleiman Souhlal
2006-11-14  2:05   ` Andi Kleen
2006-11-14  2:25     ` Suleiman Souhlal
2006-11-14  2:44       ` Andi Kleen
2006-11-14  3:35         ` dean gaudet
2006-11-14  4:22           ` dean gaudet
2006-11-14  3:54         ` Suleiman Souhlal
2006-11-14 11:12           ` Andi Kleen
2006-11-14  1:09 ` [PATCH 2/2] Introduce a vmonotonic_clock() vsyscall Suleiman Souhlal
2006-11-14  1:50 ` [PATCH 0/2] Make the TSC safe to be used by gettimeofday() Andi Kleen
2006-11-14  2:06   ` Suleiman Souhlal [this message]
2006-11-14 11:10     ` [PATCH 0/2] Make the TSC safe to be used by gettimeofday() II Andi Kleen
2006-11-14 12:30     ` [PATCH 0/2] Make the TSC safe to be used by gettimeofday() Shem Multinymous
2006-11-14 17:06       ` Suleiman Souhlal
2006-11-14 18:30         ` Andi Kleen
2006-11-14 21:28     ` Christoph Lameter
2006-11-14  7:42   ` Arjan van de Ven

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=45592497.1080109@FreeBSD.org \
    --to=ssouhlal@freebsd.org \
    --cc=ak@suse.de \
    --cc=jbohac@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vojtech@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox