<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux.git/kernel/time/hrtimer.c, branch v7.3-rc2</title>
<subtitle>Linux kernel source tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/'/>
<entry>
<title>hrtimer: Add a lockdep assertion to hrtimer_update_base()</title>
<updated>2026-08-11T16:11:20+00:00</updated>
<author>
<name>Thomas Weißschuh (Schneider Electric)</name>
<email>thomas.weissschuh@linutronix.de</email>
</author>
<published>2026-08-03T10:04:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=d2e6ee3ecb76464e7146c1b4774383fee4b48146'/>
<id>d2e6ee3ecb76464e7146c1b4774383fee4b48146</id>
<content type='text'>
Document and verify that the hrtimer_cpu_base::lock is held at this point.

Signed-off-by: Thomas Weißschuh (Schneider Electric) &lt;thomas.weissschuh@linutronix.de&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@kernel.org&gt;
Link: https://patch.msgid.link/20260803-auxclock-nanosleep-prep-v2-3-910cbd485390@linutronix.de
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Document and verify that the hrtimer_cpu_base::lock is held at this point.

Signed-off-by: Thomas Weißschuh (Schneider Electric) &lt;thomas.weissschuh@linutronix.de&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@kernel.org&gt;
Link: https://patch.msgid.link/20260803-auxclock-nanosleep-prep-v2-3-910cbd485390@linutronix.de
</pre>
</div>
</content>
</entry>
<entry>
<title>timekeeping: Use u32 for clock_was_set_seq</title>
<updated>2026-08-11T16:11:20+00:00</updated>
<author>
<name>Thomas Weißschuh (Schneider Electric)</name>
<email>thomas.weissschuh@linutronix.de</email>
</author>
<published>2026-08-03T10:04:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=406a037ce7a03a37bf2b03010791ea9343ecc233'/>
<id>406a037ce7a03a37bf2b03010791ea9343ecc233</id>
<content type='text'>
Use an explicitly sized type to make the code a bit more consistent
with other fields of the datastructure and other sequence counters.

Signed-off-by: Thomas Weißschuh (Schneider Electric) &lt;thomas.weissschuh@linutronix.de&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@kernel.org&gt;
Link: https://patch.msgid.link/20260803-auxclock-nanosleep-prep-v2-2-910cbd485390@linutronix.de
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Use an explicitly sized type to make the code a bit more consistent
with other fields of the datastructure and other sequence counters.

Signed-off-by: Thomas Weißschuh (Schneider Electric) &lt;thomas.weissschuh@linutronix.de&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@kernel.org&gt;
Link: https://patch.msgid.link/20260803-auxclock-nanosleep-prep-v2-2-910cbd485390@linutronix.de
</pre>
</div>
</content>
</entry>
<entry>
<title>hrtimer: Account nr_retries on recovered interrupt retries</title>
<updated>2026-08-11T16:08:24+00:00</updated>
<author>
<name>Liang Hao</name>
<email>haohlliang@gmail.com</email>
</author>
<published>2026-07-31T15:04:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=32a05ba399fc52661f59f38efd2e606f45eb2c8f'/>
<id>32a05ba399fc52661f59f38efd2e606f45eb2c8f</id>
<content type='text'>
Re-arranging hrtimer_interrupt() switched the retry path to a local
counter and dropped the update of cpu_base-&gt;nr_retries, leaving the
field exported via /proc/timer_list stuck at zero.

Increment nr_retries only when another pass through the expiry loop
is started; the third attempt that falls through to hang handling is
still accounted by nr_hangs alone.

Fixes: 288924384856 ("hrtimer: Re-arrange hrtimer_interrupt()")
Signed-off-by: Liang Hao &lt;haohlliang@gmail.com&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@kernel.org&gt;
Link: https://patch.msgid.link/20260731150408.19554-1-haohlliang@gmail.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Re-arranging hrtimer_interrupt() switched the retry path to a local
counter and dropped the update of cpu_base-&gt;nr_retries, leaving the
field exported via /proc/timer_list stuck at zero.

Increment nr_retries only when another pass through the expiry loop
is started; the third attempt that falls through to hang handling is
still accounted by nr_hangs alone.

Fixes: 288924384856 ("hrtimer: Re-arrange hrtimer_interrupt()")
Signed-off-by: Liang Hao &lt;haohlliang@gmail.com&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@kernel.org&gt;
Link: https://patch.msgid.link/20260731150408.19554-1-haohlliang@gmail.com
</pre>
</div>
</content>
</entry>
<entry>
<title>hrtimer: Explicitly include linux/hrtimer_bases.h</title>
<updated>2026-07-07T21:43:44+00:00</updated>
<author>
<name>Thomas Weißschuh (Schneider Electric)</name>
<email>thomas.weissschuh@linutronix.de</email>
</author>
<published>2026-07-02T09:42:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=95cf8bbadd103944c35c55e8c4cb85fa9a4ae84b'/>
<id>95cf8bbadd103944c35c55e8c4cb85fa9a4ae84b</id>
<content type='text'>
This header uses some definitions from linux/hrtimer_bases.h.
Currently this header is included transitively, which will change.

Include the header explicitly.

Signed-off-by: Thomas Weißschuh (Schneider Electric) &lt;thomas.weissschuh@linutronix.de&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@kernel.org&gt;
Link: https://patch.msgid.link/20260702-hrtimer-header-dependencies-v1-5-c50b19bda473@linutronix.de
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This header uses some definitions from linux/hrtimer_bases.h.
Currently this header is included transitively, which will change.

Include the header explicitly.

Signed-off-by: Thomas Weißschuh (Schneider Electric) &lt;thomas.weissschuh@linutronix.de&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@kernel.org&gt;
Link: https://patch.msgid.link/20260702-hrtimer-header-dependencies-v1-5-c50b19bda473@linutronix.de
</pre>
</div>
</content>
</entry>
<entry>
<title>hrtimer: Move hrtimer_update_function() to hrtimer.c</title>
<updated>2026-07-07T21:43:44+00:00</updated>
<author>
<name>Thomas Weißschuh (Schneider Electric)</name>
<email>thomas.weissschuh@linutronix.de</email>
</author>
<published>2026-07-02T09:42:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=a116c7582d7f7701736801a47e3432eb7cabd674'/>
<id>a116c7582d7f7701736801a47e3432eb7cabd674</id>
<content type='text'>
The usage of the hrtimer base forces hrtimer.h to also expose the base
structure definitions.

Move the function to hrtimer.c to avoid this.

Signed-off-by: Thomas Weißschuh (Schneider Electric) &lt;thomas.weissschuh@linutronix.de&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@kernel.org&gt;
Link: https://patch.msgid.link/20260702-hrtimer-header-dependencies-v1-3-c50b19bda473@linutronix.de
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The usage of the hrtimer base forces hrtimer.h to also expose the base
structure definitions.

Move the function to hrtimer.c to avoid this.

Signed-off-by: Thomas Weißschuh (Schneider Electric) &lt;thomas.weissschuh@linutronix.de&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@kernel.org&gt;
Link: https://patch.msgid.link/20260702-hrtimer-header-dependencies-v1-3-c50b19bda473@linutronix.de
</pre>
</div>
</content>
</entry>
<entry>
<title>hrtimer: Don't take cpu_base::lock in hrtimer_get_next_event() when hres_active</title>
<updated>2026-07-07T21:26:58+00:00</updated>
<author>
<name>Usama Arif</name>
<email>usama.arif@linux.dev</email>
</author>
<published>2026-07-07T15:38:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=c4415c993fc2c8bdf2cf0bfbcbb1ac0e0f7a9eaf'/>
<id>c4415c993fc2c8bdf2cf0bfbcbb1ac0e0f7a9eaf</id>
<content type='text'>
hrtimer_get_next_event() runs on every tick-stop decision via
get_next_timer_interrupt() -&gt; cmp_next_hrtimer_event().  When high
resolution timers are active it must return KTIME_MAX -- the caller
documents and depends on this.

The function takes cpu_base-&gt;lock, checks hres_active, and returns
KTIME_MAX.

Taking the lock is not required because cpu_base-&gt;hres_active is only
written by the local CPU in hrtimer_switch_to_hres() from hard interrupt
context and in hrtimers_cpu_starting() during bring-up.

All callers of hrtimer_get_next_event() reach it from the tick-stop /
cpuidle paths with interrupts disabled on that CPU. No writer can therefore
race with the read, so an unlocked hres_active check is stable and the lock
can be skipped in this case.

On a 176-thread AMD EPYC 9D64 running a production workload, bucketing
callers of native_queued_spin_lock_slowpath(), the slowpath had 199 samples
in total, of which 54 are attributed to hrtimer_get_next_event(), i.e. this
accounts for ~27% of slowpath hits on this specific workload.

Move the hres_active check before the lock guard region to address this.

[ tglx: Massaged change log and comments ]

Signed-off-by: Usama Arif &lt;usama.arif@linux.dev&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@kernel.org&gt;
Link: https://patch.msgid.link/20260707153800.542394-1-usama.arif@linux.dev
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
hrtimer_get_next_event() runs on every tick-stop decision via
get_next_timer_interrupt() -&gt; cmp_next_hrtimer_event().  When high
resolution timers are active it must return KTIME_MAX -- the caller
documents and depends on this.

The function takes cpu_base-&gt;lock, checks hres_active, and returns
KTIME_MAX.

Taking the lock is not required because cpu_base-&gt;hres_active is only
written by the local CPU in hrtimer_switch_to_hres() from hard interrupt
context and in hrtimers_cpu_starting() during bring-up.

All callers of hrtimer_get_next_event() reach it from the tick-stop /
cpuidle paths with interrupts disabled on that CPU. No writer can therefore
race with the read, so an unlocked hres_active check is stable and the lock
can be skipped in this case.

On a 176-thread AMD EPYC 9D64 running a production workload, bucketing
callers of native_queued_spin_lock_slowpath(), the slowpath had 199 samples
in total, of which 54 are attributed to hrtimer_get_next_event(), i.e. this
accounts for ~27% of slowpath hits on this specific workload.

Move the hres_active check before the lock guard region to address this.

[ tglx: Massaged change log and comments ]

Signed-off-by: Usama Arif &lt;usama.arif@linux.dev&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@kernel.org&gt;
Link: https://patch.msgid.link/20260707153800.542394-1-usama.arif@linux.dev
</pre>
</div>
</content>
</entry>
<entry>
<title>hrtimer: Remove unused next_timer argument from __hrtimer_reprogram()</title>
<updated>2026-07-06T15:51:36+00:00</updated>
<author>
<name>Zhan Xusheng</name>
<email>zhanxusheng1024@gmail.com</email>
</author>
<published>2026-07-06T08:45:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=d8966ca88566d94de9958a84f93bd08bfc431ee6'/>
<id>d8966ca88566d94de9958a84f93bd08bfc431ee6</id>
<content type='text'>
__hrtimer_reprogram() takes a @next_timer argument but never references
it; it only stores @expires_next into cpu_base-&gt;expires_next and
reprograms the clock event device.  The argument has been unused since
commit b14bca97c9f5 ("hrtimer: Consolidate reprogramming code").

Drop it and update the two callers.  No functional change.

Signed-off-by: Zhan Xusheng &lt;zhanxusheng@xiaomi.com&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@kernel.org&gt;
Link: https://patch.msgid.link/20260706084557.3845091-2-zhanxusheng@xiaomi.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
__hrtimer_reprogram() takes a @next_timer argument but never references
it; it only stores @expires_next into cpu_base-&gt;expires_next and
reprograms the clock event device.  The argument has been unused since
commit b14bca97c9f5 ("hrtimer: Consolidate reprogramming code").

Drop it and update the two callers.  No functional change.

Signed-off-by: Zhan Xusheng &lt;zhanxusheng@xiaomi.com&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@kernel.org&gt;
Link: https://patch.msgid.link/20260706084557.3845091-2-zhanxusheng@xiaomi.com
</pre>
</div>
</content>
</entry>
<entry>
<title>hrtimer: Remove unused clock_base_next_timer_safe()</title>
<updated>2026-06-30T16:55:08+00:00</updated>
<author>
<name>Zhan Xusheng</name>
<email>zhanxusheng1024@gmail.com</email>
</author>
<published>2026-06-25T14:09:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=034b5779b85b8ce2eacf235f41af15c21d10cf54'/>
<id>034b5779b85b8ce2eacf235f41af15c21d10cf54</id>
<content type='text'>
clock_base_next_timer_safe() was added by commit a64ad57e41c7 ("hrtimer:
Simplify run_hrtimer_queues()") but has never had a caller; the queue
iteration in __hrtimer_run_queues() uses clock_base_next_timer() instead.

The two are functionally equivalent: struct hrtimer embeds the timerqueue
node at offset 0, so container_of() of a NULL node yields NULL.  Thus
clock_base_next_timer() already returns NULL on an empty queue and the
explicit NULL check in the _safe variant is redundant.

Being a static __always_inline function it does not trigger
-Wunused-function, so the dead code has gone unnoticed.  Remove it.

No functional change.

Signed-off-by: Zhan Xusheng &lt;zhanxusheng@xiaomi.com&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@kernel.org&gt;
Link: https://patch.msgid.link/20260625140901.929554-1-zhanxusheng@xiaomi.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
clock_base_next_timer_safe() was added by commit a64ad57e41c7 ("hrtimer:
Simplify run_hrtimer_queues()") but has never had a caller; the queue
iteration in __hrtimer_run_queues() uses clock_base_next_timer() instead.

The two are functionally equivalent: struct hrtimer embeds the timerqueue
node at offset 0, so container_of() of a NULL node yields NULL.  Thus
clock_base_next_timer() already returns NULL on an empty queue and the
explicit NULL check in the _safe variant is redundant.

Being a static __always_inline function it does not trigger
-Wunused-function, so the dead code has gone unnoticed.  Remove it.

No functional change.

Signed-off-by: Zhan Xusheng &lt;zhanxusheng@xiaomi.com&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@kernel.org&gt;
Link: https://patch.msgid.link/20260625140901.929554-1-zhanxusheng@xiaomi.com
</pre>
</div>
</content>
</entry>
<entry>
<title>hrtimer: Correct CONFIG_NO_HZ_COMMON macro name in comment</title>
<updated>2026-06-17T15:59:45+00:00</updated>
<author>
<name>Ethan Nelson-Moore</name>
<email>enelsonmoore@gmail.com</email>
</author>
<published>2026-06-09T03:43:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=f8aceb1adb05896d66a3abbc1b0f41b90c9179ae'/>
<id>f8aceb1adb05896d66a3abbc1b0f41b90c9179ae</id>
<content type='text'>
A comment in kernel/time/hrtimer.c incorrectly refers to
CONFIG_NOHZ_COMMON instead of CONFIG_NO_HZ_COMMON. Correct it.

Discovered while searching for CONFIG_* symbols referenced in code but
not defined in any Kconfig file.

Signed-off-by: Ethan Nelson-Moore &lt;enelsonmoore@gmail.com&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@kernel.org&gt;
Link: https://patch.msgid.link/20260609034314.25029-1-enelsonmoore@gmail.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
A comment in kernel/time/hrtimer.c incorrectly refers to
CONFIG_NOHZ_COMMON instead of CONFIG_NO_HZ_COMMON. Correct it.

Discovered while searching for CONFIG_* symbols referenced in code but
not defined in any Kconfig file.

Signed-off-by: Ethan Nelson-Moore &lt;enelsonmoore@gmail.com&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@kernel.org&gt;
Link: https://patch.msgid.link/20260609034314.25029-1-enelsonmoore@gmail.com
</pre>
</div>
</content>
</entry>
<entry>
<title>hrtimer: Fix the bogus return type of __hrtimer_start_range_ns()</title>
<updated>2026-05-13T20:41:12+00:00</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@kernel.org</email>
</author>
<published>2026-05-13T12:59:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=5d330d652d7a455b2215c38e7b0c6149c6f8225d'/>
<id>5d330d652d7a455b2215c38e7b0c6149c6f8225d</id>
<content type='text'>
__hrtimer_start_range_ns() has a bool return type, but returns actually
three different values, which are checked at the call site.

Make the return type int.

Fixes: bd5956166d20 ("hrtimer: Provide hrtimer_start_range_ns_user()")
Reported-by: Dan Carpenter &lt;error27@gmail.com
Signed-off-by: Thomas Gleixner &lt;tglx@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
__hrtimer_start_range_ns() has a bool return type, but returns actually
three different values, which are checked at the call site.

Make the return type int.

Fixes: bd5956166d20 ("hrtimer: Provide hrtimer_start_range_ns_user()")
Reported-by: Dan Carpenter &lt;error27@gmail.com
Signed-off-by: Thomas Gleixner &lt;tglx@kernel.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
