* [PATCH 0/3] hrtimer: Some header cleanups
@ 2026-01-07 10:36 Thomas Weißschuh
2026-01-07 10:36 ` [PATCH 1/3] hrtimer: Remove unused resolution constants Thomas Weißschuh
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Thomas Weißschuh @ 2026-01-07 10:36 UTC (permalink / raw)
To: Anna-Maria Behnsen, Frederic Weisbecker, Thomas Gleixner
Cc: linux-kernel, Thomas Weißschuh
Remove some definitions from the global linux/hrtimer.h header.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
---
Thomas Weißschuh (3):
hrtimer: Remove unused resolution constants
hrtimer: Remove public definition of HIGH_RES_NSEC
hrtimer: Drop _tv64() helpers
include/linux/hrtimer.h | 15 ---------------
include/linux/hrtimer_defs.h | 20 --------------------
kernel/time/hrtimer.c | 14 +++++++++++---
3 files changed, 11 insertions(+), 38 deletions(-)
---
base-commit: 8f0b4cce4481fb22653697cced8d0d04027cb1e8
change-id: 20260105-hrtimer-header-cleanup-e55d98e811f8
Best regards,
--
Thomas Weißschuh <thomas.weissschuh@linutronix.de>
^ permalink raw reply [flat|nested] 7+ messages in thread* [PATCH 1/3] hrtimer: Remove unused resolution constants 2026-01-07 10:36 [PATCH 0/3] hrtimer: Some header cleanups Thomas Weißschuh @ 2026-01-07 10:36 ` Thomas Weißschuh 2026-01-13 10:06 ` [tip: timers/core] " tip-bot2 for Thomas Weißschuh 2026-01-07 10:36 ` [PATCH 2/3] hrtimer: Remove public definition of HIGH_RES_NSEC Thomas Weißschuh 2026-01-07 10:36 ` [PATCH 3/3] hrtimer: Drop _tv64() helpers Thomas Weißschuh 2 siblings, 1 reply; 7+ messages in thread From: Thomas Weißschuh @ 2026-01-07 10:36 UTC (permalink / raw) To: Anna-Maria Behnsen, Frederic Weisbecker, Thomas Gleixner Cc: linux-kernel, Thomas Weißschuh These constants are never used, remove them. Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> --- include/linux/hrtimer_defs.h | 8 -------- 1 file changed, 8 deletions(-) diff --git a/include/linux/hrtimer_defs.h b/include/linux/hrtimer_defs.h index aa49ffa130e5..e0280d851455 100644 --- a/include/linux/hrtimer_defs.h +++ b/include/linux/hrtimer_defs.h @@ -15,14 +15,6 @@ * this resolution values. */ # define HIGH_RES_NSEC 1 -# define KTIME_HIGH_RES (HIGH_RES_NSEC) -# define MONOTONIC_RES_NSEC HIGH_RES_NSEC -# define KTIME_MONOTONIC_RES KTIME_HIGH_RES - -#else - -# define MONOTONIC_RES_NSEC LOW_RES_NSEC -# define KTIME_MONOTONIC_RES KTIME_LOW_RES #endif -- 2.52.0 ^ permalink raw reply [flat|nested] 7+ messages in thread
* [tip: timers/core] hrtimer: Remove unused resolution constants 2026-01-07 10:36 ` [PATCH 1/3] hrtimer: Remove unused resolution constants Thomas Weißschuh @ 2026-01-13 10:06 ` tip-bot2 for Thomas Weißschuh 0 siblings, 0 replies; 7+ messages in thread From: tip-bot2 for Thomas Weißschuh @ 2026-01-13 10:06 UTC (permalink / raw) To: linux-tip-commits; +Cc: thomas.weissschuh, Thomas Gleixner, x86, linux-kernel The following commit has been merged into the timers/core branch of tip: Commit-ID: 0483e5e1dc78f53c540b19231e9cf5571ce01d50 Gitweb: https://git.kernel.org/tip/0483e5e1dc78f53c540b19231e9cf5571ce01d50 Author: Thomas Weißschuh <thomas.weissschuh@linutronix.de> AuthorDate: Wed, 07 Jan 2026 11:36:56 +01:00 Committer: Thomas Gleixner <tglx@kernel.org> CommitterDate: Tue, 13 Jan 2026 11:05:48 +01:00 hrtimer: Remove unused resolution constants These constants are never used, remove them. Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Signed-off-by: Thomas Gleixner <tglx@kernel.org> Link: https://patch.msgid.link/20260107-hrtimer-header-cleanup-v1-1-1a698ef0ddae@linutronix.de --- include/linux/hrtimer_defs.h | 8 -------- 1 file changed, 8 deletions(-) diff --git a/include/linux/hrtimer_defs.h b/include/linux/hrtimer_defs.h index aa49ffa..e0280d8 100644 --- a/include/linux/hrtimer_defs.h +++ b/include/linux/hrtimer_defs.h @@ -15,14 +15,6 @@ * this resolution values. */ # define HIGH_RES_NSEC 1 -# define KTIME_HIGH_RES (HIGH_RES_NSEC) -# define MONOTONIC_RES_NSEC HIGH_RES_NSEC -# define KTIME_MONOTONIC_RES KTIME_HIGH_RES - -#else - -# define MONOTONIC_RES_NSEC LOW_RES_NSEC -# define KTIME_MONOTONIC_RES KTIME_LOW_RES #endif ^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 2/3] hrtimer: Remove public definition of HIGH_RES_NSEC 2026-01-07 10:36 [PATCH 0/3] hrtimer: Some header cleanups Thomas Weißschuh 2026-01-07 10:36 ` [PATCH 1/3] hrtimer: Remove unused resolution constants Thomas Weißschuh @ 2026-01-07 10:36 ` Thomas Weißschuh 2026-01-13 10:06 ` [tip: timers/core] " tip-bot2 for Thomas Weißschuh 2026-01-07 10:36 ` [PATCH 3/3] hrtimer: Drop _tv64() helpers Thomas Weißschuh 2 siblings, 1 reply; 7+ messages in thread From: Thomas Weißschuh @ 2026-01-07 10:36 UTC (permalink / raw) To: Anna-Maria Behnsen, Frederic Weisbecker, Thomas Gleixner Cc: linux-kernel, Thomas Weißschuh This constant is only used in a single place and is has a very generic name polluting the global namespace. Move the constant closer to its only user. Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> --- include/linux/hrtimer_defs.h | 12 ------------ kernel/time/hrtimer.c | 8 ++++++++ 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/include/linux/hrtimer_defs.h b/include/linux/hrtimer_defs.h index e0280d851455..02b010df6570 100644 --- a/include/linux/hrtimer_defs.h +++ b/include/linux/hrtimer_defs.h @@ -6,18 +6,6 @@ #include <linux/timerqueue.h> #include <linux/seqlock.h> -#ifdef CONFIG_HIGH_RES_TIMERS - -/* - * The resolution of the clocks. The resolution value is returned in - * the clock_getres() system call to give application programmers an - * idea of the (in)accuracy of timers. Timer values are rounded up to - * this resolution values. - */ -# define HIGH_RES_NSEC 1 - -#endif - #ifdef CONFIG_64BIT # define __hrtimer_clock_base_align ____cacheline_aligned #else diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c index f8ea8c8fc895..2d319f8aff14 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c @@ -49,6 +49,14 @@ #include "tick-internal.h" +/* + * The resolution of the clocks. The resolution value is returned in + * the clock_getres() system call to give application programmers an + * idea of the (in)accuracy of timers. Timer values are rounded up to + * this resolution values. + */ +#define HIGH_RES_NSEC 1 + /* * Masks for selecting the soft and hard context timers from * cpu_base->active -- 2.52.0 ^ permalink raw reply [flat|nested] 7+ messages in thread
* [tip: timers/core] hrtimer: Remove public definition of HIGH_RES_NSEC 2026-01-07 10:36 ` [PATCH 2/3] hrtimer: Remove public definition of HIGH_RES_NSEC Thomas Weißschuh @ 2026-01-13 10:06 ` tip-bot2 for Thomas Weißschuh 0 siblings, 0 replies; 7+ messages in thread From: tip-bot2 for Thomas Weißschuh @ 2026-01-13 10:06 UTC (permalink / raw) To: linux-tip-commits; +Cc: thomas.weissschuh, Thomas Gleixner, x86, linux-kernel The following commit has been merged into the timers/core branch of tip: Commit-ID: 84663a5ad6333e8dcb57be9bb113f592e05b33c6 Gitweb: https://git.kernel.org/tip/84663a5ad6333e8dcb57be9bb113f592e05b33c6 Author: Thomas Weißschuh <thomas.weissschuh@linutronix.de> AuthorDate: Wed, 07 Jan 2026 11:36:57 +01:00 Committer: Thomas Gleixner <tglx@kernel.org> CommitterDate: Tue, 13 Jan 2026 11:05:48 +01:00 hrtimer: Remove public definition of HIGH_RES_NSEC This constant is only used in a single place and is has a very generic name polluting the global namespace. Move the constant closer to its only user. Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Signed-off-by: Thomas Gleixner <tglx@kernel.org> Link: https://patch.msgid.link/20260107-hrtimer-header-cleanup-v1-2-1a698ef0ddae@linutronix.de --- include/linux/hrtimer_defs.h | 12 ------------ kernel/time/hrtimer.c | 8 ++++++++ 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/include/linux/hrtimer_defs.h b/include/linux/hrtimer_defs.h index e0280d8..02b010d 100644 --- a/include/linux/hrtimer_defs.h +++ b/include/linux/hrtimer_defs.h @@ -6,18 +6,6 @@ #include <linux/timerqueue.h> #include <linux/seqlock.h> -#ifdef CONFIG_HIGH_RES_TIMERS - -/* - * The resolution of the clocks. The resolution value is returned in - * the clock_getres() system call to give application programmers an - * idea of the (in)accuracy of timers. Timer values are rounded up to - * this resolution values. - */ -# define HIGH_RES_NSEC 1 - -#endif - #ifdef CONFIG_64BIT # define __hrtimer_clock_base_align ____cacheline_aligned #else diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c index f8ea8c8..2d319f8 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c @@ -50,6 +50,14 @@ #include "tick-internal.h" /* + * The resolution of the clocks. The resolution value is returned in + * the clock_getres() system call to give application programmers an + * idea of the (in)accuracy of timers. Timer values are rounded up to + * this resolution values. + */ +#define HIGH_RES_NSEC 1 + +/* * Masks for selecting the soft and hard context timers from * cpu_base->active */ ^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 3/3] hrtimer: Drop _tv64() helpers 2026-01-07 10:36 [PATCH 0/3] hrtimer: Some header cleanups Thomas Weißschuh 2026-01-07 10:36 ` [PATCH 1/3] hrtimer: Remove unused resolution constants Thomas Weißschuh 2026-01-07 10:36 ` [PATCH 2/3] hrtimer: Remove public definition of HIGH_RES_NSEC Thomas Weißschuh @ 2026-01-07 10:36 ` Thomas Weißschuh 2026-01-13 10:06 ` [tip: timers/core] " tip-bot2 for Thomas Weißschuh 2 siblings, 1 reply; 7+ messages in thread From: Thomas Weißschuh @ 2026-01-07 10:36 UTC (permalink / raw) To: Anna-Maria Behnsen, Frederic Weisbecker, Thomas Gleixner Cc: linux-kernel, Thomas Weißschuh Since ktime_t has become an alias to s64, these helpers are unnecessary. Migrate the few remaining users to the regular helpers and remove the now dead code. Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> --- include/linux/hrtimer.h | 15 --------------- kernel/time/hrtimer.c | 6 +++--- 2 files changed, 3 insertions(+), 18 deletions(-) diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h index 2cf1bf65b225..eb2d3d9dd064 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h @@ -112,12 +112,6 @@ static inline void hrtimer_set_expires_range_ns(struct hrtimer *timer, ktime_t t timer->node.expires = ktime_add_safe(time, ns_to_ktime(delta)); } -static inline void hrtimer_set_expires_tv64(struct hrtimer *timer, s64 tv64) -{ - timer->node.expires = tv64; - timer->_softexpires = tv64; -} - static inline void hrtimer_add_expires(struct hrtimer *timer, ktime_t time) { timer->node.expires = ktime_add_safe(timer->node.expires, time); @@ -140,15 +134,6 @@ static inline ktime_t hrtimer_get_softexpires(const struct hrtimer *timer) return timer->_softexpires; } -static inline s64 hrtimer_get_expires_tv64(const struct hrtimer *timer) -{ - return timer->node.expires; -} -static inline s64 hrtimer_get_softexpires_tv64(const struct hrtimer *timer) -{ - return timer->_softexpires; -} - static inline s64 hrtimer_get_expires_ns(const struct hrtimer *timer) { return ktime_to_ns(timer->node.expires); diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c index 2d319f8aff14..d0ab2e9e3f30 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c @@ -814,7 +814,7 @@ static void hrtimer_reprogram(struct hrtimer *timer, bool reprogram) struct hrtimer_clock_base *base = timer->base; ktime_t expires = ktime_sub(hrtimer_get_expires(timer), base->offset); - WARN_ON_ONCE(hrtimer_get_expires_tv64(timer) < 0); + WARN_ON_ONCE(hrtimer_get_expires(timer) < 0); /* * CLOCK_REALTIME timer might be requested with an absolute @@ -1061,7 +1061,7 @@ u64 hrtimer_forward(struct hrtimer *timer, ktime_t now, ktime_t interval) orun = ktime_divns(delta, incr); hrtimer_add_expires_ns(timer, incr * orun); - if (hrtimer_get_expires_tv64(timer) > now) + if (hrtimer_get_expires(timer) > now) return orun; /* * This (and the ktime_add() below) is the @@ -1843,7 +1843,7 @@ static void __hrtimer_run_queues(struct hrtimer_cpu_base *cpu_base, ktime_t now, * are right-of a not yet expired timer, because that * timer will have to trigger a wakeup anyway. */ - if (basenow < hrtimer_get_softexpires_tv64(timer)) + if (basenow < hrtimer_get_softexpires(timer)) break; __run_hrtimer(cpu_base, base, timer, &basenow, flags); -- 2.52.0 ^ permalink raw reply [flat|nested] 7+ messages in thread
* [tip: timers/core] hrtimer: Drop _tv64() helpers 2026-01-07 10:36 ` [PATCH 3/3] hrtimer: Drop _tv64() helpers Thomas Weißschuh @ 2026-01-13 10:06 ` tip-bot2 for Thomas Weißschuh 0 siblings, 0 replies; 7+ messages in thread From: tip-bot2 for Thomas Weißschuh @ 2026-01-13 10:06 UTC (permalink / raw) To: linux-tip-commits; +Cc: thomas.weissschuh, Thomas Gleixner, x86, linux-kernel The following commit has been merged into the timers/core branch of tip: Commit-ID: ae4535b0d9372ca90a24f2d9970310ee48eb3cc2 Gitweb: https://git.kernel.org/tip/ae4535b0d9372ca90a24f2d9970310ee48eb3cc2 Author: Thomas Weißschuh <thomas.weissschuh@linutronix.de> AuthorDate: Wed, 07 Jan 2026 11:36:58 +01:00 Committer: Thomas Gleixner <tglx@kernel.org> CommitterDate: Tue, 13 Jan 2026 11:05:49 +01:00 hrtimer: Drop _tv64() helpers Since ktime_t has become an alias to s64, these helpers are unnecessary. Migrate the few remaining users to the regular helpers and remove the now dead code. Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Signed-off-by: Thomas Gleixner <tglx@kernel.org> Link: https://patch.msgid.link/20260107-hrtimer-header-cleanup-v1-3-1a698ef0ddae@linutronix.de --- include/linux/hrtimer.h | 15 --------------- kernel/time/hrtimer.c | 6 +++--- 2 files changed, 3 insertions(+), 18 deletions(-) diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h index 2cf1bf6..eb2d3d9 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h @@ -112,12 +112,6 @@ static inline void hrtimer_set_expires_range_ns(struct hrtimer *timer, ktime_t t timer->node.expires = ktime_add_safe(time, ns_to_ktime(delta)); } -static inline void hrtimer_set_expires_tv64(struct hrtimer *timer, s64 tv64) -{ - timer->node.expires = tv64; - timer->_softexpires = tv64; -} - static inline void hrtimer_add_expires(struct hrtimer *timer, ktime_t time) { timer->node.expires = ktime_add_safe(timer->node.expires, time); @@ -140,15 +134,6 @@ static inline ktime_t hrtimer_get_softexpires(const struct hrtimer *timer) return timer->_softexpires; } -static inline s64 hrtimer_get_expires_tv64(const struct hrtimer *timer) -{ - return timer->node.expires; -} -static inline s64 hrtimer_get_softexpires_tv64(const struct hrtimer *timer) -{ - return timer->_softexpires; -} - static inline s64 hrtimer_get_expires_ns(const struct hrtimer *timer) { return ktime_to_ns(timer->node.expires); diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c index 2d319f8..d0ab2e9 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c @@ -814,7 +814,7 @@ static void hrtimer_reprogram(struct hrtimer *timer, bool reprogram) struct hrtimer_clock_base *base = timer->base; ktime_t expires = ktime_sub(hrtimer_get_expires(timer), base->offset); - WARN_ON_ONCE(hrtimer_get_expires_tv64(timer) < 0); + WARN_ON_ONCE(hrtimer_get_expires(timer) < 0); /* * CLOCK_REALTIME timer might be requested with an absolute @@ -1061,7 +1061,7 @@ u64 hrtimer_forward(struct hrtimer *timer, ktime_t now, ktime_t interval) orun = ktime_divns(delta, incr); hrtimer_add_expires_ns(timer, incr * orun); - if (hrtimer_get_expires_tv64(timer) > now) + if (hrtimer_get_expires(timer) > now) return orun; /* * This (and the ktime_add() below) is the @@ -1843,7 +1843,7 @@ static void __hrtimer_run_queues(struct hrtimer_cpu_base *cpu_base, ktime_t now, * are right-of a not yet expired timer, because that * timer will have to trigger a wakeup anyway. */ - if (basenow < hrtimer_get_softexpires_tv64(timer)) + if (basenow < hrtimer_get_softexpires(timer)) break; __run_hrtimer(cpu_base, base, timer, &basenow, flags); ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2026-01-13 10:06 UTC | newest] Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2026-01-07 10:36 [PATCH 0/3] hrtimer: Some header cleanups Thomas Weißschuh 2026-01-07 10:36 ` [PATCH 1/3] hrtimer: Remove unused resolution constants Thomas Weißschuh 2026-01-13 10:06 ` [tip: timers/core] " tip-bot2 for Thomas Weißschuh 2026-01-07 10:36 ` [PATCH 2/3] hrtimer: Remove public definition of HIGH_RES_NSEC Thomas Weißschuh 2026-01-13 10:06 ` [tip: timers/core] " tip-bot2 for Thomas Weißschuh 2026-01-07 10:36 ` [PATCH 3/3] hrtimer: Drop _tv64() helpers Thomas Weißschuh 2026-01-13 10:06 ` [tip: timers/core] " tip-bot2 for Thomas Weißschuh
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®