[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+8MBbLX_cLR1+DpjuG-D5=5YhnTy3aGS4RL1iviRYomYoveWg@mail.gmail.com>
Date: Fri, 20 Jul 2012 09:33:23 -0700
From: Tony Luck <tony.luck@...el.com>
To: Borislav Petkov <bp@...64.org>
Cc: linux-kernel@...r.kernel.org, Ingo Molnar <mingo@...e.hu>,
Chen Gong <gong.chen@...ux.intel.com>,
"Huang, Ying" <ying.huang@...el.com>,
Hidetoshi Seto <seto.hidetoshi@...fujitsu.com>
Subject: Re: [PATCH 2/2] x86/mce: Add quirk for instruction recovery on Sandy
Bridge processors
> 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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists