mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 06:44:00 -04:00
Currently hrtimer_interrupt() runs expired timers, which can re-arm themselves, after which it computes the next expiration time and re-programs the hardware. However, things like HRTICK, a highres timer driving preemption, cannot re-arm itself at the point of running, since the next task has not been determined yet. The schedule() in the interrupt return path will switch to the next task, which then causes a new hrtimer to be programmed. This then results in reprogramming the hardware at least twice, once after running the timers, and once upon selecting the new task. Notably, *both* events happen in the interrupt. By pushing the hrtimer reprogram all the way into the interrupt return path, it runs after schedule() picks the new task and the double reprogram can be avoided. Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Signed-off-by: Thomas Gleixner <tglx@kernel.org> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://patch.msgid.link/20260224163431.273488269@kernel.org
55 lines
1.7 KiB
C
55 lines
1.7 KiB
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#ifndef _ASM_GENERIC_THREAD_INFO_TIF_H_
|
|
#define _ASM_GENERIC_THREAD_INFO_TIF_H_
|
|
|
|
#include <vdso/bits.h>
|
|
|
|
/* Bits 16-31 are reserved for architecture specific purposes */
|
|
|
|
#define TIF_NOTIFY_RESUME 0 // callback before returning to user
|
|
#define _TIF_NOTIFY_RESUME BIT(TIF_NOTIFY_RESUME)
|
|
|
|
#define TIF_SIGPENDING 1 // signal pending
|
|
#define _TIF_SIGPENDING BIT(TIF_SIGPENDING)
|
|
|
|
#define TIF_NOTIFY_SIGNAL 2 // signal notifications exist
|
|
#define _TIF_NOTIFY_SIGNAL BIT(TIF_NOTIFY_SIGNAL)
|
|
|
|
#define TIF_MEMDIE 3 // is terminating due to OOM killer
|
|
#define _TIF_MEMDIE BIT(TIF_MEMDIE)
|
|
|
|
#define TIF_NEED_RESCHED 4 // rescheduling necessary
|
|
#define _TIF_NEED_RESCHED BIT(TIF_NEED_RESCHED)
|
|
|
|
#ifdef HAVE_TIF_NEED_RESCHED_LAZY
|
|
# define TIF_NEED_RESCHED_LAZY 5 // Lazy rescheduling needed
|
|
# define _TIF_NEED_RESCHED_LAZY BIT(TIF_NEED_RESCHED_LAZY)
|
|
#endif
|
|
|
|
#ifdef HAVE_TIF_POLLING_NRFLAG
|
|
# define TIF_POLLING_NRFLAG 6 // idle is polling for TIF_NEED_RESCHED
|
|
# define _TIF_POLLING_NRFLAG BIT(TIF_POLLING_NRFLAG)
|
|
#endif
|
|
|
|
#define TIF_USER_RETURN_NOTIFY 7 // notify kernel of userspace return
|
|
#define _TIF_USER_RETURN_NOTIFY BIT(TIF_USER_RETURN_NOTIFY)
|
|
|
|
#define TIF_UPROBE 8 // breakpointed or singlestepping
|
|
#define _TIF_UPROBE BIT(TIF_UPROBE)
|
|
|
|
#define TIF_PATCH_PENDING 9 // pending live patching update
|
|
#define _TIF_PATCH_PENDING BIT(TIF_PATCH_PENDING)
|
|
|
|
#ifdef HAVE_TIF_RESTORE_SIGMASK
|
|
# define TIF_RESTORE_SIGMASK 10 // Restore signal mask in do_signal()
|
|
# define _TIF_RESTORE_SIGMASK BIT(TIF_RESTORE_SIGMASK)
|
|
#endif
|
|
|
|
#define TIF_RSEQ 11 // Run RSEQ fast path
|
|
#define _TIF_RSEQ BIT(TIF_RSEQ)
|
|
|
|
#define TIF_HRTIMER_REARM 12 // re-arm the timer
|
|
#define _TIF_HRTIMER_REARM BIT(TIF_HRTIMER_REARM)
|
|
|
|
#endif /* _ASM_GENERIC_THREAD_INFO_TIF_H_ */
|