GCC options for kernel live-patching (Was: Add a new option to control inlining only on static functions)

Martin Jambor mjambor@suse.cz
Wed Oct 3 10:53:00 GMT 2018


Hi,

On Tue, Oct 02 2018, Qing Zhao wrote:
> So, here comes the next question:
>
> what will be the better approach for helping live-patching?
>
> A. disable all the optimization/analyzes that changing a function based on other functions.  this includes most of 
> the IPA optimizations, inlining, cloning, ipa side effect analysis, etc.

We came to the conclusion that we do not want to disable (any) inlining
- primarily for performance reasons but also because of always_inline.
When you have to deal with inlining, you can use the same mechanism for
IPA-CP clones, IPA-SRA and anything that creates clones and callers need
to be patched.

Always_inline is also the reason why I would discourage anyone from
attempting this, it looks too much like an irresolvable conflict.

>
> B. enable all such optimizations, but compute the list of possibly affected functions from those IPA optimizations.

Although certainly possible, we came to the conclusion that it would be
impractical to attempt to track all decisions affected by, say, a
function being pure, or a variable read-only, etc.  Impractical to the
point when at least I personally would also discourage anyone from
attempting this too, it would be necessary to record this info deep
inside AA, VRP, who know what else, and keep it up to date.

>
> C. enable part of them and disable the other part of them.  for the part of enabled ones,  compute the list of possibly affected functions
> from them.

Which means we would like to go this route.

Martin



More information about the Gcc-patches mailing list