lkml.org 
[lkml]   [2020]   [Nov]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH 6/7] preempt/dynamic: Provide irqentry_exit_cond_resched() static call
On Tue, Nov 10, 2020 at 01:56:08AM +0100, Frederic Weisbecker wrote:
> [convert from static key to static call, only define static call when
> PREEMPT_DYNAMIC]

> noinstr void irqentry_exit(struct pt_regs *regs, irqentry_state_t state)
> {
> @@ -383,8 +386,13 @@ noinstr void irqentry_exit(struct pt_regs *regs, irqentry_state_t state)
> }
>
> instrumentation_begin();
> - if (IS_ENABLED(CONFIG_PREEMPTION))
> + if (IS_ENABLED(CONFIG_PREEMPTION)) {
> +#ifdef CONFIG_PREEMT_DYNAMIC
> + static_call(irqentry_exit_cond_resched)();
> +#else
> irqentry_exit_cond_resched();
> +#endif
> + }
> /* Covers both tracing and lockdep */
> trace_hardirqs_on();
> instrumentation_end();

The reason I had this a static_branch() is that because if you look at
the code-gen of this function, you'll find it will inline the call.

Not sure it matters much, but it avoids a CALL+RET.

\
 
 \ /
  Last update: 2020-11-10 11:34    [W:0.118 / U:0.120 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site