lkml.org 
[lkml]   [2015]   [Jun]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v5 00/10] x86/asm: Compile-time asm code validation
On Wed, Jun 10, 2015 at 10:31:55AM -0500, Josh Poimboeuf wrote:
> On Wed, Jun 10, 2015 at 05:04:12PM +0200, Andi Kleen wrote:
> > It's not needed, but it's an optimization to optimize icache usage.
> > It is optional (-freorder-blocks-and-partition)
> >
> > In this case gcc splits the function into two (hot and cold)
> >
> > It's actually a nice optimization and it would be sad from stopping
> > the kernel from using it.
>
> Sorry if I wasn't clear, I was trying to ask for examples in kernel asm
> code.
>
> Are you suggesting that we implement this gcc optimization in kernel asm
> code?

If you're wanting something like -freorder-blocks-and-partition for asm
code, maybe we could implement something analagous to the
likely()/unlikely() macros, to allow the hot and cold portions to be
placed into different sections. (I could then teach asmvalidate how to
validate such code.)

Would that be useful?

--
Josh


\
 
 \ /
  Last update: 2015-06-10 19:01    [W:0.302 / U:1.800 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site