Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

hrtimer: Rename hrtimer_cpu_base::in_hrtirq to deferred_rearm

The upcoming deferred rearming scheme has the same effect as the deferred
rearming when the hrtimer interrupt is executing. So it can reuse the
in_hrtirq flag, but when it gets deferred beyond the hrtimer interrupt
path, then the name does not make sense anymore.

Rename it to deferred_rearm upfront to keep the actual functional change
separate from the mechanical rename churn.

Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://patch.msgid.link/20260224163430.935623347@kernel.org

authored by

Thomas Gleixner and committed by
Peter Zijlstra
9e07a9c9 28892438

+11 -21
+2 -2
include/linux/hrtimer_defs.h
··· 53 53 * @active_bases: Bitfield to mark bases with active timers 54 54 * @clock_was_set_seq: Sequence counter of clock was set events 55 55 * @hres_active: State of high resolution mode 56 - * @in_hrtirq: hrtimer_interrupt() is currently executing 56 + * @deferred_rearm: A deferred rearm is pending 57 57 * @hang_detected: The last hrtimer interrupt detected a hang 58 58 * @softirq_activated: displays, if the softirq is raised - update of softirq 59 59 * related settings is not required then. ··· 84 84 unsigned int active_bases; 85 85 unsigned int clock_was_set_seq; 86 86 bool hres_active; 87 - bool in_hrtirq; 87 + bool deferred_rearm; 88 88 bool hang_detected; 89 89 bool softirq_activated; 90 90 bool online;
+9 -19
kernel/time/hrtimer.c
··· 883 883 if (expires >= cpu_base->expires_next) 884 884 return; 885 885 886 - /* 887 - * If the hrtimer interrupt is running, then it will reevaluate the 888 - * clock bases and reprogram the clock event device. 889 - */ 890 - if (cpu_base->in_hrtirq) 886 + /* If a deferred rearm is pending skip reprogramming the device */ 887 + if (cpu_base->deferred_rearm) 891 888 return; 892 889 893 890 cpu_base->next_timer = timer; ··· 918 921 if (seq == cpu_base->clock_was_set_seq) 919 922 return false; 920 923 921 - /* 922 - * If the remote CPU is currently handling an hrtimer interrupt, it 923 - * will reevaluate the first expiring timer of all clock bases 924 - * before reprogramming. Nothing to do here. 925 - */ 926 - if (cpu_base->in_hrtirq) 924 + /* If a deferred rearm is pending the remote CPU will take care of it */ 925 + if (cpu_base->deferred_rearm) 927 926 return false; 928 927 929 928 /* ··· 1327 1334 first = enqueue_hrtimer(timer, base, mode, was_armed); 1328 1335 } 1329 1336 1330 - /* 1331 - * If the hrtimer interrupt is running, then it will reevaluate the 1332 - * clock bases and reprogram the clock event device. 1333 - */ 1334 - if (cpu_base->in_hrtirq) 1337 + /* If a deferred rearm is pending skip reprogramming the device */ 1338 + if (cpu_base->deferred_rearm) 1335 1339 return false; 1336 1340 1337 1341 if (!was_first || cpu_base != this_cpu_base) { ··· 1937 1947 1938 1948 /* 1939 1949 * Very similar to hrtimer_force_reprogram(), except it deals with 1940 - * in_hrtirq and hang_detected. 1950 + * deferred_rearm and hang_detected. 1941 1951 */ 1942 1952 static void hrtimer_rearm(struct hrtimer_cpu_base *cpu_base, ktime_t now) 1943 1953 { 1944 1954 ktime_t expires_next = hrtimer_update_next_event(cpu_base); 1945 1955 1946 1956 cpu_base->expires_next = expires_next; 1947 - cpu_base->in_hrtirq = false; 1957 + cpu_base->deferred_rearm = false; 1948 1958 1949 1959 if (unlikely(cpu_base->hang_detected)) { 1950 1960 /* ··· 1975 1985 raw_spin_lock_irqsave(&cpu_base->lock, flags); 1976 1986 entry_time = now = hrtimer_update_base(cpu_base); 1977 1987 retry: 1978 - cpu_base->in_hrtirq = true; 1988 + cpu_base->deferred_rearm = true; 1979 1989 /* 1980 1990 * Set expires_next to KTIME_MAX, which prevents that remote CPUs queue 1981 1991 * timers while __hrtimer_run_queues() is expiring the clock bases.