Re: [git pull] scheduler updates

From: Ingo Molnar
Date: Sat Nov 08 2008 - 14:30:25 EST



* Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:

> On Sat, 8 Nov 2008, Ingo Molnar wrote:
> >
> > So that's why my change moves it from the __native_read_tsc() over to
> > _only_ the vget_cycles().
>
> Ahh. I was looking at native_read_tscp(). Which has no barriers. But then
> we don't actually save the actual TSC, we only end up using the "p" part,
> so we don't care..
>
> Anyway, even for the vget_cycles(), is there really any reason to
> have _two_ barriers? Also, I still think it would be a hell of a lot
> more readable and logical to put the barriers in the _caller_, so
> that people actually see what the barriers are there for.
>
> When they are hidden, they make no sense. The helper function just
> has two insane barriers without explanation, and the caller doesn't
> know that the code is serialized wrt something random.

ok, fully agreed, i've queued up the cleanup for that, see it below.

sidenote: i still kept the get_cycles() versus vget_cycles()
distinction, to preserve the explicit marker that vget_cycles() is
used in user-space mode code. We periodically forgot about that in the
past. But otherwise, the two inline functions are now identical.
(except for the assymetry of its inlining, and the comment about the
boot_cpu_data use of the has_tsc check)

Ingo

--------------->