sched/preempt: Refactor sched_dynamic_update()
authorMark Rutland <mark.rutland@arm.com>
Mon, 14 Feb 2022 16:52:11 +0000 (16:52 +0000)
committerPeter Zijlstra <peterz@infradead.org>
Sat, 19 Feb 2022 10:11:07 +0000 (11:11 +0100)
commit8a69fe0be143b0a1af829f85f0e9a1ae7d6a04db
treefc8581807db4feff86d0097630d3628a004027ba
parent4c7485584d48f60b1e742c7c6a3a1fa503d48d97
sched/preempt: Refactor sched_dynamic_update()

Currently sched_dynamic_update needs to open-code the enabled/disabled
function names for each preemption model it supports, when in practice
this is a boolean enabled/disabled state for each function.

Make this clearer and avoid repetition by defining the enabled/disabled
states at the function definition, and using helper macros to perform the
static_call_update(). Where x86 currently overrides the enabled
function, it is made to provide both the enabled and disabled states for
consistency, with defaults provided by the core code otherwise.

In subsequent patches this will allow us to support PREEMPT_DYNAMIC
without static calls.

There should be no functional change as a result of this patch.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Ard Biesheuvel <ardb@kernel.org>
Acked-by: Frederic Weisbecker <frederic@kernel.org>
Link: https://lore.kernel.org/r/20220214165216.2231574-3-mark.rutland@arm.com
arch/x86/include/asm/preempt.h
include/linux/entry-common.h
kernel/sched/core.c