Re: [PATCH v6 13/17] static_call: Add static_call_cond()

2020-07-14 Thread Peter Zijlstra
On Mon, Jul 13, 2020 at 04:32:39PM -0400, Steven Rostedt wrote: > On Sat, 11 Jul 2020 12:49:30 +0200 > Peter Zijlstra wrote: > > > > Something like so (on top of the next patch) ? > > > > I'm not convinced it actually helps much, but if it makes you feel > > better :-) > > After you have

Re: [PATCH v6 13/17] static_call: Add static_call_cond()

2020-07-13 Thread Steven Rostedt
On Sat, 11 Jul 2020 12:49:30 +0200 Peter Zijlstra wrote: > > Something like so (on top of the next patch) ? > > I'm not convinced it actually helps much, but if it makes you feel > better :-) After you have bricked a bunch of people's NICs, you would be paranoid about this too! You work for

Re: [PATCH v6 13/17] static_call: Add static_call_cond()

2020-07-11 Thread Peter Zijlstra
On Fri, Jul 10, 2020 at 07:08:25PM -0400, Steven Rostedt wrote: > On Fri, 10 Jul 2020 15:38:44 +0200 > Peter Zijlstra wrote: > > > +static void __static_call_transform(void *insn, enum insn_type type, void > > *func) > > { > > - const void *code = text_gen_insn(opcode, insn, func); > > +

Re: [PATCH v6 13/17] static_call: Add static_call_cond()

2020-07-10 Thread Peter Zijlstra
On Fri, Jul 10, 2020 at 07:08:25PM -0400, Steven Rostedt wrote: > On Fri, 10 Jul 2020 15:38:44 +0200 > Peter Zijlstra wrote: > > > +static void __static_call_transform(void *insn, enum insn_type type, void > > *func) > > { > > - const void *code = text_gen_insn(opcode, insn, func); > > +

Re: [PATCH v6 13/17] static_call: Add static_call_cond()

2020-07-10 Thread Steven Rostedt
On Fri, 10 Jul 2020 15:38:44 +0200 Peter Zijlstra wrote: > +static void __static_call_transform(void *insn, enum insn_type type, void > *func) > { > - const void *code = text_gen_insn(opcode, insn, func); > + int size = CALL_INSN_SIZE; > + const void *code; > > - if

[PATCH v6 13/17] static_call: Add static_call_cond()

2020-07-10 Thread Peter Zijlstra
Extend the static_call infrastructure to optimize the following common pattern: if (func_ptr) func_ptr(args...) For the trampoline (which is in effect a tail-call), we patch the JMP.d32 into a RET, which then directly consumes the trampoline call. For the in-line sites