Re: [PATCH] x86: branchless clear_page()

From: Alexey Dobriyan
Date: Tue Aug 23 2016 - 12:15:02 EST


On Tue, Aug 23, 2016 at 09:43:25AM -0400, Brian Gerst wrote:
> > -ENTRY(clear_page_c_e)
> > +ENTRY(clear_page_rep_stosb)
> > movl $4096,%ecx
> > xorl %eax,%eax
> > rep stosb
> > ret
> > -ENDPROC(clear_page_c_e)
> > +ENDPROC(clear_page_rep_stosb)
>
> I like this idea, but does it make sense to take it a step further and
> inline the string instruction alternatives to avoid a call altogether?

It is easy but you can't do runtime patching then.

> Also, 32-bit should be converted to do the same thing as 64-bit.

I don't run 32-bit. :-)