sched/preempt: Simplify irqentry_exit_cond_resched() callers
authorMark Rutland <mark.rutland@arm.com>
Mon, 14 Feb 2022 16:52:12 +0000 (16:52 +0000)
committerPeter Zijlstra <peterz@infradead.org>
Sat, 19 Feb 2022 10:11:08 +0000 (11:11 +0100)
commit4624a14f4daa8ab4578d274555fd8847254ce339
treed04f17f83f4ef94c9583de9af9cba0cff0c6be47
parent8a69fe0be143b0a1af829f85f0e9a1ae7d6a04db
sched/preempt: Simplify irqentry_exit_cond_resched() callers

Currently callers of irqentry_exit_cond_resched() need to be aware of
whether the function should be indirected via a static call, leading to
ugly ifdeffery in callers.

Save them the hassle with a static inline wrapper that does the right
thing. The raw_irqentry_exit_cond_resched() will also be useful in
subsequent patches which will add conditional wrappers for preemption
functions.

Note: in arch/x86/entry/common.c, xen_pv_evtchn_do_upcall() always calls
irqentry_exit_cond_resched() directly, even when PREEMPT_DYNAMIC is in
use. I believe this is a latent bug (which this patch corrects), but I'm
not entirely certain this wasn't deliberate.

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-4-mark.rutland@arm.com
include/linux/entry-common.h
kernel/entry/common.c