lkml.org 
[lkml]   [2022]   [Mar]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v4 5/7] sched/preempt: add PREEMPT_DYNAMIC using static keys
Date
Hi Mark,

Mark Rutland <mark.rutland@arm.com> writes:

> diff --git a/kernel/entry/common.c b/kernel/entry/common.c
> index 1739ca79613b..b145249ad91a 100644
> --- a/kernel/entry/common.c
> +++ b/kernel/entry/common.c
> @@ -3,6 +3,7 @@
> #include <linux/context_tracking.h>
> #include <linux/entry-common.h>
> #include <linux/highmem.h>
> +#include <linux/jump_label.h>
> #include <linux/livepatch.h>
> #include <linux/audit.h>
> #include <linux/tick.h>
> @@ -392,7 +393,17 @@ void raw_irqentry_exit_cond_resched(void)
> }
> }
> #ifdef CONFIG_PREEMPT_DYNAMIC
> +#if defined(CONFIG_HAVE_PREEMPT_DYNAMIC_CALL)
> DEFINE_STATIC_CALL(irqentry_exit_cond_resched, raw_irqentry_exit_cond_resched);
> +#elif defined(CONFIG_HAVE_PREEMPT_DYNAMIC_KEY)
> +DEFINE_STATIC_KEY_TRUE(sk_dynamic_irqentry_exit_cond_resched);
> +void dynamic_irqentry_exit_cond_resched(void)
> +{
> + if (!static_key_unlikely(&sk_dynamic_irqentry_exit_cond_resched))
> + return;

I think that should be static_branch_unlikely()?

Also can we make dynamic_irqentry_exit_cond_resched static so that the
compiler will inline it? I played a bit with your changes on s390 and
noticed the the compiler will generate an empty function. Declaring it
static inlines it and saves one unnecessary function call.

Thanks!
Sven

\
 
 \ /
  Last update: 2022-03-18 09:51    [W:0.127 / U:0.228 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site