From: Ingo Molnar <mingo@elte.hu>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: john stultz <johnstul@us.ibm.com>,
Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>,
"Luck, Tony" <tony.luck@intel.com>,
Steven Rostedt <rostedt@goodmis.org>,
Andrew Morton <akpm@linux-foundation.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-arch@vger.kernel.org" <linux-arch@vger.kernel.org>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Thomas Gleixner <tglx@linutronix.de>,
David Miller <davem@davemloft.net>,
Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>
Subject: Re: [RFC patch 15/15] LTTng timestamp x86
Date: Tue, 21 Oct 2008 00:17:44 +0200 [thread overview]
Message-ID: <20081020221744.GA30133@elte.hu> (raw)
In-Reply-To: <alpine.LFD.2.00.0810201451190.3287@nehalem.linux-foundation.org>
* Linus Torvalds <torvalds@linux-foundation.org> wrote:
> That's why I'd suggest making _purely_ local time, and then aiming for
> something NTP-like. But maybe there are better solutions out there.
this 'fast local time' was the rough idea we tried to implement via the
cpu_clock(cpu) interface.
cpu_clock() results are loosely coupled to xtime in every scheduler tick
via the scd->tick_gtod logic.
( That way in a sense it tracks NTP time as well, if NTP is fed back
into GTOD, such as when ntpd is running. Granted, this is not the same
quality at all as if it did native NTP-alike corrections, but it at
least has a long-term stability. )
And it only ever does cross-CPU work if we specifically ask for a remote
clock:
if (cpu != raw_smp_processor_id()) {
struct sched_clock_data *my_scd = this_scd();
lock_double_clock(scd, my_scd);
it still does this "serialization looking" even in the local case:
__raw_spin_lock(&scd->lock);
clock = __update_sched_clock(scd, now);
}
__raw_spin_unlock(&scd->lock);
... but that lock is strictly per CPU, so it only matters if there _is_
cross-CPU "interest" in that clock. Otherwise these locks are in essence
just per CPU and cause no cacheline bouncing, etc.
... but we could try to eliminate even that potential for any locking.
On 64-bit it's a real possibility i think. (we need the lock for 32-bit
mainly, the timestamps are all 64 bits)
... it also has all the tsc-stops-in-idle smarts, knows about cpufreq,
etc. Those things are needed even on UP, to not get really bad
transients in time.
That still leaves us with sched_clock() complexity, which has spread out
a bit more than it should have. So it's not all as simple as you'd like
it to be i think, but we are trying hard ...
Ideas to simplify/robustify it are welcome.
Ingo
next prev parent reply other threads:[~2008-10-20 22:19 UTC|newest]
Thread overview: 66+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-16 23:27 [RFC patch 00/15] Tracer Timestamping Mathieu Desnoyers
2008-10-16 23:27 ` [RFC patch 01/15] get_cycles() : kconfig HAVE_GET_CYCLES Mathieu Desnoyers
2008-10-16 23:27 ` [RFC patch 02/15] get_cycles() : x86 HAVE_GET_CYCLES Mathieu Desnoyers
2008-10-16 23:27 ` [RFC patch 03/15] get_cycles() : sparc64 HAVE_GET_CYCLES Mathieu Desnoyers
2008-10-17 2:48 ` [RFC patch 03/15] get_cycles() : sparc64 HAVE_GET_CYCLES (update) Mathieu Desnoyers
2008-10-17 2:57 ` David Miller
2008-10-16 23:27 ` [RFC patch 04/15] get_cycles() : powerpc64 HAVE_GET_CYCLES Mathieu Desnoyers
2008-10-17 0:26 ` Paul Mackerras
2008-10-17 0:43 ` [RFC patch 04/15] get_cycles() : powerpc64 HAVE_GET_CYCLES (update) Mathieu Desnoyers
2008-10-17 0:54 ` Paul Mackerras
2008-10-17 1:42 ` David Miller
2008-10-17 2:08 ` Mathieu Desnoyers
2008-10-17 2:33 ` David Miller
2008-10-16 23:27 ` [RFC patch 05/15] get_cycles() : MIPS HAVE_GET_CYCLES_32 Mathieu Desnoyers
2008-10-26 10:18 ` Ralf Baechle
2008-10-26 20:39 ` Mathieu Desnoyers
2008-10-16 23:27 ` [RFC patch 06/15] LTTng build Mathieu Desnoyers
2008-10-17 8:10 ` KOSAKI Motohiro
2008-10-17 16:18 ` Mathieu Desnoyers
2008-10-16 23:27 ` [RFC patch 07/15] LTTng timestamp Mathieu Desnoyers
2008-10-17 8:15 ` KOSAKI Motohiro
2008-10-17 16:23 ` Mathieu Desnoyers
2008-10-16 23:27 ` [RFC patch 08/15] LTTng - Timestamping Mathieu Desnoyers
2008-10-16 23:27 ` [RFC patch 09/15] LTTng mips export hpt frequency Mathieu Desnoyers
2008-10-16 23:27 ` [RFC patch 10/15] LTTng timestamp mips Mathieu Desnoyers
2008-10-16 23:27 ` [RFC patch 11/15] LTTng timestamp powerpc Mathieu Desnoyers
2008-10-16 23:27 ` [RFC patch 12/15] LTTng timestamp sparc64 Mathieu Desnoyers
2008-10-16 23:27 ` [RFC patch 13/15] LTTng timestamp sh Mathieu Desnoyers
2008-10-16 23:27 ` [RFC patch 14/15] LTTng - TSC synchronicity test Mathieu Desnoyers
2008-10-16 23:27 ` [RFC patch 15/15] LTTng timestamp x86 Mathieu Desnoyers
2008-10-17 0:08 ` Linus Torvalds
2008-10-17 0:12 ` Linus Torvalds
2008-10-17 1:28 ` Mathieu Desnoyers
2008-10-17 2:19 ` Luck, Tony
2008-10-17 17:25 ` Steven Rostedt
2008-10-17 18:08 ` Luck, Tony
2008-10-17 18:42 ` Mathieu Desnoyers
2008-10-17 18:58 ` Luck, Tony
2008-10-17 20:23 ` Mathieu Desnoyers
2008-10-17 23:52 ` Luck, Tony
2008-10-18 17:01 ` Mathieu Desnoyers
2008-10-18 17:35 ` Linus Torvalds
2008-10-18 17:50 ` Ingo Molnar
2008-10-22 16:19 ` Mathieu Desnoyers
2008-10-22 15:53 ` Mathieu Desnoyers
2008-10-20 18:07 ` Luck, Tony
2008-10-22 16:51 ` Mathieu Desnoyers
2008-10-17 19:17 ` Steven Rostedt
2008-10-20 20:10 ` Linus Torvalds
2008-10-20 21:38 ` john stultz
2008-10-20 22:06 ` Linus Torvalds
2008-10-20 22:17 ` Ingo Molnar [this message]
2008-10-20 22:29 ` H. Peter Anvin
2008-10-21 18:10 ` Bjorn Helgaas
2008-10-23 15:47 ` Linus Torvalds
2008-10-23 16:39 ` H. Peter Anvin
2008-10-23 21:54 ` Paul Mackerras
2008-10-20 23:47 ` john stultz
2008-10-22 17:05 ` Mathieu Desnoyers
2008-10-17 19:36 ` Christoph Lameter
2008-10-17 7:59 ` [RFC patch 00/15] Tracer Timestamping Peter Zijlstra
2008-10-20 20:25 ` Mathieu Desnoyers
2008-10-21 0:20 ` Nicolas Pitre
2008-10-21 1:32 ` Mathieu Desnoyers
2008-10-21 2:32 ` Nicolas Pitre
2008-10-21 4:05 ` Mathieu Desnoyers
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=20081020221744.GA30133@elte.hu \
--to=mingo@elte.hu \
--cc=a.p.zijlstra@chello.nl \
--cc=akpm@linux-foundation.org \
--cc=davem@davemloft.net \
--cc=hpa@zytor.com \
--cc=johnstul@us.ibm.com \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@polymtl.ca \
--cc=mingo@redhat.com \
--cc=rostedt@goodmis.org \
--cc=tglx@linutronix.de \
--cc=tony.luck@intel.com \
--cc=torvalds@linux-foundation.org \
/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