From: Ingo Molnar <mingo@elte.hu>
To: Andi Kleen <andi@firstfloor.org>
Cc: Andy Lutomirski <luto@MIT.EDU>,
Linus Torvalds <torvalds@linux-foundation.org>,
Nick Piggin <npiggin@suse.de>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <eric.dumazet@gmail.com>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
x86@kernel.org, Thomas Gleixner <tglx@linutronix.de>,
linux-kernel@vger.kernel.org
Subject: Re: [RFT/PATCH v2 2/6] x86-64: Optimize vread_tsc's barriers
Date: Thu, 7 Apr 2011 19:28:32 +0200 [thread overview]
Message-ID: <20110407172832.GA13304@elte.hu> (raw)
In-Reply-To: <20110407152354.GW21838@one.firstfloor.org>
* Andi Kleen <andi@firstfloor.org> wrote:
> > So the much better optimization would be to give up on exact GTOD coherency
> > and just make sure the same task does not see time going backwards. If
> > user-space wants precise coherency it can use synchronization primitives
> > itsef. By default it would get the fast and possibly off by a few cycles
> > thing instead. We'd never be seriously jump in time - only small jumps
> > would happen in practice, depending on CPU parallelism effects.
>
> That would be a big user visible break in compatibility.
Those are big scary words, but you really need to think this through:
Firstly, what is the user expectation? That a GTOD timestamp is provided. What
will the user application do with that timestamp? Store it, for later use.
So there's implicit ordering all around these timestamps.
Secondly, x86 hardware never did a good job keeping our GTOD timestamps
coherent, so while there *is* expectation for certainl behavior (Andy's for
example), it's not widespread at all.
I bet that Linus's single-side barrier approach will be good enough in practice
to meet Andy's needs. We might not be able to remove both barriers, but the
tricks look really fragile ...
Andy, mind trying out Linus's suggestion? It should bring us more of a speedup
and it would keep this code even simpler.
Thanks,
Ingo
next prev parent reply other threads:[~2011-04-07 17:28 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-07 2:03 [RFT/PATCH v2 0/6] Micro-optimize vclock_gettime Andy Lutomirski
2011-04-07 2:03 ` [RFT/PATCH v2 1/6] x86-64: Clean up vdso/kernel shared variables Andy Lutomirski
2011-04-07 8:08 ` Ingo Molnar
2011-04-07 2:03 ` [RFT/PATCH v2 2/6] x86-64: Optimize vread_tsc's barriers Andy Lutomirski
2011-04-07 8:25 ` Ingo Molnar
2011-04-07 11:44 ` Andrew Lutomirski
2011-04-07 15:23 ` Andi Kleen
2011-04-07 17:28 ` Ingo Molnar [this message]
2011-04-07 16:18 ` Linus Torvalds
2011-04-07 16:42 ` Andi Kleen
2011-04-07 17:20 ` Linus Torvalds
2011-04-07 18:15 ` Andi Kleen
2011-04-07 18:30 ` Linus Torvalds
2011-04-07 21:26 ` Andrew Lutomirski
2011-04-08 17:59 ` Andrew Lutomirski
2011-04-09 11:51 ` Ingo Molnar
2011-04-07 21:43 ` Raghavendra D Prabhu
2011-04-07 22:52 ` Andi Kleen
2011-04-07 2:04 ` [RFT/PATCH v2 3/6] x86-64: Don't generate cmov in vread_tsc Andy Lutomirski
2011-04-07 7:54 ` Ingo Molnar
2011-04-07 11:25 ` Andrew Lutomirski
2011-04-07 2:04 ` [RFT/PATCH v2 4/6] x86-64: vclock_gettime(CLOCK_MONOTONIC) can't ever see nsec < 0 Andy Lutomirski
2011-04-07 7:57 ` Ingo Molnar
2011-04-07 11:27 ` Andrew Lutomirski
2011-04-07 2:04 ` [RFT/PATCH v2 5/6] x86-64: Move vread_tsc into a new file with sensible options Andy Lutomirski
2011-04-07 2:04 ` [RFT/PATCH v2 6/6] x86-64: Turn off -pg and turn on -foptimize-sibling-calls for vDSO Andy Lutomirski
2011-04-07 8:03 ` Ingo Molnar
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=20110407172832.GA13304@elte.hu \
--to=mingo@elte.hu \
--cc=a.p.zijlstra@chello.nl \
--cc=andi@firstfloor.org \
--cc=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@MIT.EDU \
--cc=npiggin@suse.de \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
--cc=x86@kernel.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