Messages in this thread | | | From | Sven Schnelle <> | Subject | Re: [PATCH v4 5/7] sched/preempt: add PREEMPT_DYNAMIC using static keys | Date | Fri, 18 Mar 2022 09:49:25 +0100 |
| |
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
| |