lkml.org 
[lkml]   [2022]   [Feb]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH v2 5/7] sched/preempt: add PREEMPT_DYNAMIC using static keys
On Fri, Feb 04, 2022 at 03:05:55PM +0000, Mark Rutland wrote:
> diff --git a/include/linux/entry-common.h b/include/linux/entry-common.h
> index dfd84c59b144..141952f4fee8 100644
> --- a/include/linux/entry-common.h
> +++ b/include/linux/entry-common.h
> @@ -456,13 +456,19 @@ irqentry_state_t noinstr irqentry_enter(struct pt_regs *regs);
> */
> void raw_irqentry_exit_cond_resched(void);
> #ifdef CONFIG_PREEMPT_DYNAMIC
> +#if defined(CONFIG_HAVE_PREEMPT_DYNAMIC_CALL)
> #define irqentry_exit_cond_resched_dynamic_enabled raw_irqentry_exit_cond_resched
> #define irqentry_exit_cond_resched_dynamic_disabled NULL
> DECLARE_STATIC_CALL(irqentry_exit_cond_resched, raw_irqentry_exit_cond_resched);
> #define irqentry_exit_cond_resched() static_call(irqentry_exit_cond_resched)()
> -#else
> -#define irqentry_exit_cond_resched() raw_irqentry_exit_cond_resched()
> +#elif defined(CONFIG_HAVE_PREEMPT_DYNAMIC_KEY)
> +DECLARE_STATIC_KEY_TRUE(sk_dynamic_irqentry_exit_cond_resched);

If CONFIG_PREEMPT && CONFIG_PREEMPT_DYNAMIC and no "preempt=" parameter is
passed, nothing is overriden on boot. So you need to either have cond_resched
and might_resched initially disabled (STATIC_KEY_FALSE?) or call
sched_dynamic_update() from preempt_dynamic_init() also when CONFIG_PREEMPT=y.

Thanks.

\
 
 \ /
  Last update: 2022-02-07 14:11    [W:0.097 / U:2.736 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site