2015-02-11 21:56:08

by H. Peter Anvin

[permalink] [raw]
Subject: Re: [PATCH] x86/smpboot: check if CLFLUSH is actually necessary

On 01/30/2015 01:26 PM, Scotty Bauer wrote:
> mwait_play_dead previously issued a CLFLUSH to work around a bug on
> some xeon processors. We can now determine if the CPU is a buggy CPU.
> This patch checks if if we're on a buggy CPU which allows non-buggy
> cpu's to eliminate the CLFLUSH.

Here is my first question: does this matter at all? Otherwise I don't
see a point.

-hpa


2015-02-11 23:10:23

by Scott Bauer

[permalink] [raw]
Subject: Re: [PATCH] x86/smpboot: check if CLFLUSH is actually necessary


On 02/11/2015 02:55 PM, H. Peter Anvin wrote:
> On 01/30/2015 01:26 PM, Scotty Bauer wrote:
>> mwait_play_dead previously issued a CLFLUSH to work around a bug on
>> some xeon processors. We can now determine if the CPU is a buggy CPU.
>> This patch checks if if we're on a buggy CPU which allows non-buggy
>> cpu's to eliminate the CLFLUSH.
> Here is my first question: does this matter at all? Otherwise I don't
> see a point.
>
> -hpa
>
>
Do you get the same effect? Sure, but is the previous way the right way to do it? In my opinion no, but I'm not the one merging code its up to someone more experienced to determine if the change is warranted. The change is slightly faster on non-buggy cpu, but like you mention, is that relevant when the machine is going into idle?

2015-02-12 09:16:55

by Borislav Petkov

[permalink] [raw]
Subject: Re: [PATCH] x86/smpboot: check if CLFLUSH is actually necessary

On Wed, Feb 11, 2015 at 04:10:12PM -0700, Scotty Bauer wrote:
> Do you get the same effect? Sure, but is the previous way the right
> way to do it? In my opinion no, but I'm not the one merging code
> its up to someone more experienced to determine if the change is
> warranted. The change is slightly faster on non-buggy cpu, but like
> you mention, is that relevant when the machine is going into idle?

Right, it probably doesn't matter on the way to idle but we could do the
change just to make the code the same as in mwait_idle_with_hints() so
that there are no more why-is-this-different questions in the future.

Or even make it a small function called prepare_monitor() and put the
if-check in there and call that function in both places...

--
Regards/Gruss,
Boris.

ECO tip #101: Trim your mails when you reply.
--