lkml.org 
[lkml]   [2016]   [Apr]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/6] x86/fpu/regset: Use boot_cpu_has()
On Tue, Apr 05, 2016 at 09:51:55AM -0400, Brian Gerst wrote:
> I think the general rule should be always use static_cpu_has() for
> runtime checks, since it reduces down to a single jmp/nop instruction
> after alternatives run. Even if it's not a hot path, it saves a bit
> of runtime memory.

So gcc generates a MOV and a TEST for boot_cpu_has(). Not exactly the
bloat or slowdown.

So I look at those differently: static_cpu_has()

a) should be used on hotpaths

b) is used as such to annotate those - i.e., "ah, there's a
static_cpu_has(), this is a hot path, I better be careful what I'm doing
here."

boot_cpu_has() in all the rest.

And saving a couple of bytes per call site but increasing alternatives
application time by milli- or microseconds... Meh. I don't see it being
really worth the trouble. But this is just me.

--
Regards/Gruss,
Boris.

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

\
 
 \ /
  Last update: 2016-04-05 18:01    [W:0.276 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site