lkml.org 
[lkml]   [2012]   [Jul]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 2/2] x86/mce: Add quirk for instruction recovery on Sandy Bridge processors
From
> Maybe define a default empty quirk_no_way_out() on the remaining
> families/vendors so that the compiler can optimize it away and we save
> ourselves the if-test?

Perhaps I misunderstood your suggestion. I don't see how the compiler will
manage to optimize it all away. I just tried defining

static void quirk_no_way_out_nop(int bank, struct mce *m, struct pt_regs *regs)
{
}

and providing that as an initial value for the quirk_no_way_out
function pointer.

Then I deleted the "if (quirk_no_way_out)".

Looking at the assembly code produced, I now just have an unconditional call:

callq *0x9fe992(%rip) # ffffffff81a18668 <quirk_no_way_out>


I'd think that a call through a function pointer to an empty function is
more expensive that testing whether that function pointer was NULL.

-Tony


\
 
 \ /
  Last update: 2012-07-20 19:21    [W:0.541 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site