From: Ingo Molnar <mingo@elte.hu>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Arjan van de Ven <arjan@infradead.org>,
linux-kernel@vger.kernel.org,
Andrew Morton <akpm@linux-foundation.org>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Mike Galbraith <efault@gmx.de>
Subject: Re: [git pull] scheduler updates
Date: Sat, 8 Nov 2008 20:10:10 +0100 [thread overview]
Message-ID: <20081108191010.GA12852@elte.hu> (raw)
In-Reply-To: <alpine.LFD.2.00.0811081051190.3468@nehalem.linux-foundation.org>
* Linus Torvalds <torvalds@linux-foundation.org> wrote:
> On Sat, 8 Nov 2008, Arjan van de Ven wrote:
> >
> > historically it was for early AMD cpus (K7, not sure if early K8 did
> > this) where 2 consecutive rdtsc's in the same codestream would get
> > reordered compared to eachother, so you could observe the tsc go
> > backwards...
>
> .. but this only happens with two _consecutive_ ones.
>
> The thing is, nobody sane does that in generic code. The scheduler wants
> to have cycles, yes, but two consecutive scheduler invocations will have
> spinlocks etc in between. That's true of _all_ sane uses of a TSC.
>
> I don't see that there is ever any reason to do the barriers for any
> normal case. And the cases where it does matter would actually be worth
> pointing out (ie making the barriers explicit in those cases, and those
> cases only).
>
> Doing it in get_cycles() and "forgetting about it" may sound like a simple
> solution, but it's likely wrong. For example, one of the few cases where
> we realy care about time going backwards is gettimeofday() - which uses
> tsc, but which also has tons of serializing instructions on its own.
> EXCEPT WHEN IT IS a vsyscall!
>
> But in that case, we don't even have the barrier, because we put it in the
> wrong function and 'forgot about it'. Of course, we may not need it
> (rdtscp maybe always serializes, I didn't check), but the point is, an
> explicit barrier is actually better than one that is hidden.
>
> So who _really_ needs it? And why not just do it there?
i think, the tree as offered to you, intends to do just that, unless i
made some grave (and unintended) mistake somewhere.
The barrier is only present in the vread function: which is the
vsyscall-read function, to be used from user-space.
Even in the past, no was actually forgotten or put in the wrong
function as far as i can see because previously _everything_
(including the vread method) had the barrier.
The change from me simply removes the barrier from the places that
dont need it - exactly for the reason you outlined: the scheduler is
both imprecise and has a ton of natural serialization anyway, so it's
a non-issue there.
Hm?
Ingo
next prev parent reply other threads:[~2008-11-08 19:10 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-08 17:02 [git pull] scheduler updates Ingo Molnar
2008-11-08 18:28 ` Linus Torvalds
2008-11-08 18:38 ` Linus Torvalds
2008-11-08 18:41 ` Arjan van de Ven
2008-11-08 19:00 ` Linus Torvalds
2008-11-08 19:05 ` Ingo Molnar
2008-11-08 19:20 ` Linus Torvalds
2008-11-08 19:29 ` Ingo Molnar
2008-11-17 22:43 ` Venki Pallipadi
2008-11-17 22:50 ` Ingo Molnar
2008-11-17 23:04 ` Venki Pallipadi
2008-11-17 23:13 ` Ingo Molnar
2008-11-08 19:40 ` Ingo Molnar
2008-11-08 19:10 ` Ingo Molnar [this message]
2008-11-08 18:52 ` Ingo Molnar
2008-11-08 18:57 ` Ingo Molnar
2008-11-08 19:32 ` Ingo Molnar
-- strict thread matches above, loose matches on Subject: below --
2018-02-06 21:38 [GIT PULL] " Ingo Molnar
2008-03-21 16:23 [git pull] " Ingo Molnar
2008-02-29 18:04 Ingo Molnar
2008-02-13 15:58 Ingo Molnar
2008-01-31 21:54 Ingo Molnar
2007-12-30 16:45 Ingo Molnar
2007-10-24 16:39 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=20081108191010.GA12852@elte.hu \
--to=mingo@elte.hu \
--cc=a.p.zijlstra@chello.nl \
--cc=akpm@linux-foundation.org \
--cc=arjan@infradead.org \
--cc=efault@gmx.de \
--cc=linux-kernel@vger.kernel.org \
--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