Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1429781

Re: [PATCH] Disable non-ABI-compliant optimisations for live patching

From Jiri Kosina <jikos@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH] Disable non-ABI-compliant optimisations for live patching
Date 2016-06-23 14:50 +0200
Message-ID <rNceZ-1AV-17@gated-at.bofh.it> (permalink)
References <rMRkd-4AB-11@gated-at.bofh.it> <rMS6B-57o-7@gated-at.bofh.it> <rN7yF-6MX-7@gated-at.bofh.it> <rN9Ka-8oP-23@gated-at.bofh.it> <rNamS-cC-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, 23 Jun 2016, Jiri Kosina wrote:

> > I haven't looked at the fentry solution, but the code I'm involved in saves
> > the registers so that ftrace, live patch and friends can work freely. But
> > then it restores all regs and _then_ calls the replacement, so ftrace
> > saving all regs is no gain at all.
> 
> You're right, thanks for bringing this up.
> 
> In principle we should be able to modify the trampoline so that it 
> performs its own register saving (in ftrace_regs_caller) and restoring 
> (*), completely shielding the new function from any optimization gcc might 
> have done on registers, shouldn't we?
> 
> (*) we'll have to piggy-back on ftrace_epilogue on that, i.e. making the 
>     return to the original code go through trampoline as well (the same 
>     way graph tracer works)

Okay, after looking more about how ftrace implements the return 
trampolines for graph caller, it'd be rather difficult to implement in a 
way that we neither interfere with ftrace graph tracer (the 
ftrace_ret_stack in task_struct) nor introduce a serious performance 
overhead or stack usage pressure.

I am pretty sure the overhead we'd be adding would be much worse than just 
really simply turning the IPA-RA off in CONFIG_LIVEPATCH-enabled kernels 
is the easiest way to go.

After talking to Jan Hubicka, I'd actually suggest turning off most/all 
the IPA optimizations; they are supposed to be of questionable benefit for 
kernel anyway, and they might be causing serious issues for us.

I am planning to ask our performance team to measure the impact this'd 
have.

Thanks,

-- 
Jiri Kosina
SUSE Labs

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] Disable non-ABI-compliant optimisations for live patching Torsten Duwe <duwe@lst.de> - 2016-06-22 16:30 +0200
  Re: [PATCH] Disable non-ABI-compliant optimisations for live patching Josh Poimboeuf <jpoimboe@redhat.com> - 2016-06-22 17:20 +0200
    Re: [PATCH] Disable non-ABI-compliant optimisations for live  patching Miroslav Benes <mbenes@suse.cz> - 2016-06-23 09:50 +0200
      Re: [PATCH] Disable non-ABI-compliant optimisations for live  patching Torsten Duwe <duwe@lst.de> - 2016-06-23 12:10 +0200
        Re: [PATCH] Disable non-ABI-compliant optimisations for live  patching Jiri Kosina <jikos@kernel.org> - 2016-06-23 12:50 +0200
          Re: [PATCH] Disable non-ABI-compliant optimisations for live  patching Jiri Kosina <jikos@kernel.org> - 2016-06-23 14:50 +0200
            Re: [PATCH] Disable non-ABI-compliant optimisations for live patching Pavel Machek <pavel@ucw.cz> - 2016-06-27 00:50 +0200
              Re: [PATCH] Disable non-ABI-compliant optimisations for live patching Torsten Duwe <duwe@lst.de> - 2016-06-27 09:10 +0200
  Re: [PATCH] Disable non-ABI-compliant optimisations for live patching Pavel Machek <pavel@ucw.cz> - 2016-06-27 00:40 +0200
    Re: [PATCH] Disable non-ABI-compliant optimisations for live  patching Jiri Kosina <jikos@kernel.org> - 2016-06-27 10:20 +0200
      Re: [PATCH] Disable non-ABI-compliant optimisations for live  patching Jiri Kosina <jikos@kernel.org> - 2016-06-27 10:30 +0200
        Re: [PATCH] Disable non-ABI-compliant optimisations for live patching Pavel Machek <pavel@ucw.cz> - 2016-06-27 10:40 +0200
          Re: [PATCH] Disable non-ABI-compliant optimisations for live  patching Jiri Kosina <jikos@kernel.org> - 2016-06-27 13:40 +0200
      Re: [PATCH] Disable non-ABI-compliant optimisations for live patching Pavel Machek <pavel@ucw.cz> - 2016-06-27 10:30 +0200

csiph-web