Re: [RFC PATCH 6/8] preempt/dynamic: Provide preempt_schedule[_notrace]() static calls

2021-02-06 Thread Peter Zijlstra
On Fri, Feb 05, 2021 at 08:31:22PM -0600, Josh Poimboeuf wrote: > On Fri, Feb 05, 2021 at 04:30:56PM +0100, Peter Zijlstra wrote: > > On Wed, Feb 03, 2021 at 03:04:23PM +0100, Peter Zijlstra wrote: > > > Fair enough I suppose. I'll slap a changelog and your SoB on it and I > > > suppose I'll got

Re: [RFC PATCH 6/8] preempt/dynamic: Provide preempt_schedule[_notrace]() static calls

2021-02-05 Thread Josh Poimboeuf
On Fri, Feb 05, 2021 at 04:30:56PM +0100, Peter Zijlstra wrote: > On Wed, Feb 03, 2021 at 03:04:23PM +0100, Peter Zijlstra wrote: > > Fair enough I suppose. I'll slap a changelog and your SoB on it and I > > suppose I'll got commit the whole lot. Then we can forget about it > > again. > > FWIW,

Re: [RFC PATCH 6/8] preempt/dynamic: Provide preempt_schedule[_notrace]() static calls

2021-02-05 Thread Peter Zijlstra
On Wed, Jan 27, 2021 at 05:18:37PM -0600, Josh Poimboeuf wrote: > +static struct static_call_tramp_key *tramp_key_lookup(unsigned long addr) > +{ > + struct static_call_tramp_key *start = __start_static_call_tramp_key; > + struct static_call_tramp_key *stop = __stop_static_call_tramp_key;

Re: [RFC PATCH 6/8] preempt/dynamic: Provide preempt_schedule[_notrace]() static calls

2021-02-05 Thread Peter Zijlstra
On Wed, Feb 03, 2021 at 03:04:23PM +0100, Peter Zijlstra wrote: > Fair enough I suppose. I'll slap a changelog and your SoB on it and I > suppose I'll got commit the whole lot. Then we can forget about it > again. FWIW, the whole thing looks like this.. --- Subject: static_call: Allow module use

Re: [RFC PATCH 6/8] preempt/dynamic: Provide preempt_schedule[_notrace]() static calls

2021-02-03 Thread Peter Zijlstra
On Wed, Jan 27, 2021 at 05:18:37PM -0600, Josh Poimboeuf wrote: > On Wed, Jan 27, 2021 at 01:02:18PM -0600, Josh Poimboeuf wrote: > > On Wed, Jan 27, 2021 at 01:00:07PM -0600, Josh Poimboeuf wrote: > > > On Wed, Jan 27, 2021 at 07:44:01PM +0100, Peter Zijlstra wrote: > > > > On Wed, Jan 27, 2021

Re: [RFC PATCH 6/8] preempt/dynamic: Provide preempt_schedule[_notrace]() static calls

2021-01-27 Thread Josh Poimboeuf
On Wed, Jan 27, 2021 at 01:02:18PM -0600, Josh Poimboeuf wrote: > On Wed, Jan 27, 2021 at 01:00:07PM -0600, Josh Poimboeuf wrote: > > On Wed, Jan 27, 2021 at 07:44:01PM +0100, Peter Zijlstra wrote: > > > On Wed, Jan 27, 2021 at 10:33:08AM -0600, Josh Poimboeuf wrote: > > > > > > > What did you

Re: [RFC PATCH 6/8] preempt/dynamic: Provide preempt_schedule[_notrace]() static calls

2021-01-27 Thread Josh Poimboeuf
On Wed, Jan 27, 2021 at 01:00:07PM -0600, Josh Poimboeuf wrote: > On Wed, Jan 27, 2021 at 07:44:01PM +0100, Peter Zijlstra wrote: > > On Wed, Jan 27, 2021 at 10:33:08AM -0600, Josh Poimboeuf wrote: > > > > > What did you think about .static_call_tramp_key? I could whip up a > > > patch later

Re: [RFC PATCH 6/8] preempt/dynamic: Provide preempt_schedule[_notrace]() static calls

2021-01-27 Thread Josh Poimboeuf
On Wed, Jan 27, 2021 at 07:44:01PM +0100, Peter Zijlstra wrote: > On Wed, Jan 27, 2021 at 10:33:08AM -0600, Josh Poimboeuf wrote: > > > What did you think about .static_call_tramp_key? I could whip up a > > patch later unless you beat me to it. > > Yeah, I'm not sure.. why duplicate information

Re: [RFC PATCH 6/8] preempt/dynamic: Provide preempt_schedule[_notrace]() static calls

2021-01-27 Thread Peter Zijlstra
On Wed, Jan 27, 2021 at 10:33:08AM -0600, Josh Poimboeuf wrote: > What did you think about .static_call_tramp_key? I could whip up a > patch later unless you beat me to it. Yeah, I'm not sure.. why duplicate information already present in kallsyms? There's a fair number of features that

Re: [RFC PATCH 6/8] preempt/dynamic: Provide preempt_schedule[_notrace]() static calls

2021-01-27 Thread Josh Poimboeuf
On Wed, Jan 27, 2021 at 05:19:02PM +0100, Peter Zijlstra wrote: > On Wed, Jan 27, 2021 at 09:59:14AM -0600, Josh Poimboeuf wrote: > > On Wed, Jan 27, 2021 at 12:27:09PM +0100, Peter Zijlstra wrote: > > > On Wed, Jan 27, 2021 at 10:13:47AM +0100, Peter Zijlstra wrote: > > > > On Tue, Jan 26, 2021

Re: [RFC PATCH 6/8] preempt/dynamic: Provide preempt_schedule[_notrace]() static calls

2021-01-27 Thread Peter Zijlstra
On Wed, Jan 27, 2021 at 09:59:14AM -0600, Josh Poimboeuf wrote: > On Wed, Jan 27, 2021 at 12:27:09PM +0100, Peter Zijlstra wrote: > > On Wed, Jan 27, 2021 at 10:13:47AM +0100, Peter Zijlstra wrote: > > > On Tue, Jan 26, 2021 at 05:57:30PM -0600, Josh Poimboeuf wrote: > > > > > > Well, I hate it,

Re: [RFC PATCH 6/8] preempt/dynamic: Provide preempt_schedule[_notrace]() static calls

2021-01-27 Thread Josh Poimboeuf
On Wed, Jan 27, 2021 at 12:27:09PM +0100, Peter Zijlstra wrote: > On Wed, Jan 27, 2021 at 10:13:47AM +0100, Peter Zijlstra wrote: > > On Tue, Jan 26, 2021 at 05:57:30PM -0600, Josh Poimboeuf wrote: > > > > Well, I hate it, but I'm not sure I have any better ideas. It should be > > > possible to

Re: [RFC PATCH 6/8] preempt/dynamic: Provide preempt_schedule[_notrace]() static calls

2021-01-27 Thread Peter Zijlstra
On Wed, Jan 27, 2021 at 10:13:47AM +0100, Peter Zijlstra wrote: > On Tue, Jan 26, 2021 at 05:57:30PM -0600, Josh Poimboeuf wrote: > > Well, I hate it, but I'm not sure I have any better ideas. It should be > > possible to use kallsyms, instead of the rb-tree/register nonsense. Not > > sure

Re: [RFC PATCH 6/8] preempt/dynamic: Provide preempt_schedule[_notrace]() static calls

2021-01-27 Thread Peter Zijlstra
On Tue, Jan 26, 2021 at 05:57:30PM -0600, Josh Poimboeuf wrote: > On Fri, Jan 22, 2021 at 05:52:26PM +0100, Peter Zijlstra wrote: > > static int static_call_add_module(struct module *mod) > > { > > - return __static_call_init(mod, mod->static_call_sites, > > -

Re: [RFC PATCH 6/8] preempt/dynamic: Provide preempt_schedule[_notrace]() static calls

2021-01-26 Thread Josh Poimboeuf
On Fri, Jan 22, 2021 at 05:52:26PM +0100, Peter Zijlstra wrote: > static int static_call_add_module(struct module *mod) > { > - return __static_call_init(mod, mod->static_call_sites, > - mod->static_call_sites + > mod->num_static_call_sites); > + struct

Re: [RFC PATCH 6/8] preempt/dynamic: Provide preempt_schedule[_notrace]() static calls

2021-01-26 Thread Peter Zijlstra
On Mon, Jan 25, 2021 at 05:40:39PM -0600, Josh Poimboeuf wrote: > On Fri, Jan 22, 2021 at 05:52:26PM +0100, Peter Zijlstra wrote: > > On Mon, Jan 18, 2021 at 03:12:21PM +0100, Frederic Weisbecker wrote: > > > +#ifdef CONFIG_PREEMPT_DYNAMIC > > > +DEFINE_STATIC_CALL(preempt_schedule,

Re: [RFC PATCH 6/8] preempt/dynamic: Provide preempt_schedule[_notrace]() static calls

2021-01-25 Thread Josh Poimboeuf
On Fri, Jan 22, 2021 at 05:52:26PM +0100, Peter Zijlstra wrote: > On Mon, Jan 18, 2021 at 03:12:21PM +0100, Frederic Weisbecker wrote: > > +#ifdef CONFIG_PREEMPT_DYNAMIC > > +DEFINE_STATIC_CALL(preempt_schedule, __preempt_schedule_func()); > > +EXPORT_STATIC_CALL(preempt_schedule); > > +#endif >

Re: [RFC PATCH 6/8] preempt/dynamic: Provide preempt_schedule[_notrace]() static calls

2021-01-22 Thread Peter Zijlstra
On Mon, Jan 18, 2021 at 03:12:21PM +0100, Frederic Weisbecker wrote: > +#ifdef CONFIG_PREEMPT_DYNAMIC > +DEFINE_STATIC_CALL(preempt_schedule, __preempt_schedule_func()); > +EXPORT_STATIC_CALL(preempt_schedule); > +#endif > +#ifdef CONFIG_PREEMPT_DYNAMIC >

Re: [RFC PATCH 6/8] preempt/dynamic: Provide preempt_schedule[_notrace]() static calls

2021-01-22 Thread Peter Zijlstra
On Fri, Jan 22, 2021 at 05:57:53PM +0100, Ard Biesheuvel wrote: > On Fri, 22 Jan 2021 at 17:53, Peter Zijlstra wrote: > > > > On Mon, Jan 18, 2021 at 03:12:21PM +0100, Frederic Weisbecker wrote: > > > +#ifdef CONFIG_PREEMPT_DYNAMIC > > > +DEFINE_STATIC_CALL(preempt_schedule,

Re: [RFC PATCH 6/8] preempt/dynamic: Provide preempt_schedule[_notrace]() static calls

2021-01-22 Thread Ard Biesheuvel
On Fri, 22 Jan 2021 at 17:53, Peter Zijlstra wrote: > > On Mon, Jan 18, 2021 at 03:12:21PM +0100, Frederic Weisbecker wrote: > > +#ifdef CONFIG_PREEMPT_DYNAMIC > > +DEFINE_STATIC_CALL(preempt_schedule, __preempt_schedule_func()); > > +EXPORT_STATIC_CALL(preempt_schedule); > > +#endif > > >

Re: [RFC PATCH 6/8] preempt/dynamic: Provide preempt_schedule[_notrace]() static calls

2021-01-21 Thread Peter Zijlstra
On Thu, Jan 21, 2021 at 10:58:26PM +0100, Peter Zijlstra wrote: > I'm thinking the above doesn't build for !PREEMPT_DYNAMIC, given it > relies on the STATIC_CALL unconditionally, but we only define it for > PREEMPT_DYNAMIC: Ooh, I see, x86 cannot get there anymore.

Re: [RFC PATCH 6/8] preempt/dynamic: Provide preempt_schedule[_notrace]() static calls

2021-01-21 Thread Peter Zijlstra
On Mon, Jan 18, 2021 at 03:12:21PM +0100, Frederic Weisbecker wrote: > diff --git a/arch/x86/include/asm/preempt.h b/arch/x86/include/asm/preempt.h > index 69485ca13665..3db9cb8b1a25 100644 > --- a/arch/x86/include/asm/preempt.h > +++ b/arch/x86/include/asm/preempt.h > @@ -5,6 +5,7 @@ > #include

[RFC PATCH 6/8] preempt/dynamic: Provide preempt_schedule[_notrace]() static calls

2021-01-18 Thread Frederic Weisbecker
From: "Peter Zijlstra (Intel)" Provide static calls to control preempt_schedule[_notrace]() (called in CONFIG_PREEMPT) so that we can override their behaviour when preempt= is overriden. Since the default behaviour is full preemption, both their calls are initialized to the arch provided