mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] tick: Include ktime.h and jiffies.h in linux/tick.h
@ 2026-07-22  6:21 Karl Mehltretter
  2026-08-08 20:27 ` Karl Mehltretter
  2026-08-10 14:43 ` [tip: timers/urgent] " tip-bot2 for Karl Mehltretter
  0 siblings, 2 replies; 3+ messages in thread
From: Karl Mehltretter @ 2026-07-22  6:21 UTC (permalink / raw)
  To: Anna-Maria Behnsen, Frederic Weisbecker, Ingo Molnar, Thomas Gleixner
  Cc: Karl Mehltretter, linux-kernel

The !CONFIG_NO_HZ_COMMON stubs use ktime_add(), ktime_get() and
TICK_NSEC, but tick.h includes neither <linux/ktime.h> nor
<linux/jiffies.h>. Most configurations build only because those
declarations arrive transitively.

Commit 6440966067dc ("cpuset: Remove cpuset_cpu_is_isolated()") removed
<linux/cpuset.h> from <linux/sched/isolation.h>. The <linux/cpuset.h>
include chain had been satisfying these declarations before
<linux/tick.h> was parsed. Commit 8aa76aa41589 ("ring-buffer: Use a
housekeeping CPU to wake up waiters") then added
<linux/sched/isolation.h> to ring_buffer.c ahead of any header which
provides them. Neither change is wrong on its own: the failure requires
both and appeared in v7.0.

ARM rpc_defconfig + CONFIG_FUNCTION_TRACER fails to build:

  $ make ARCH=arm rpc_defconfig
  $ ./scripts/config -e FTRACE -e FUNCTION_TRACER
  $ make ARCH=arm olddefconfig
  $ make ARCH=arm kernel/trace/ring_buffer.o
  In file included from include/linux/sched/isolation.h:6,
                   from kernel/trace/ring_buffer.c:8:
  include/linux/tick.h: In function 'tick_nohz_get_next_hrtimer':
  include/linux/tick.h:156:9: error: implicit declaration of function
      'ktime_add'; did you mean 'size_add'?
  include/linux/tick.h:156:19: error: implicit declaration of function
      'ktime_get'; did you mean 'time_init'?
  include/linux/tick.h:156:32: error: 'TICK_NSEC' undeclared

Include the headers the file actually uses.

Fixes: 8aa76aa41589 ("ring-buffer: Use a housekeeping CPU to wake up waiters")
Assisted-by: Codex:gpt-5.6-sol
Signed-off-by: Karl Mehltretter <kmehltretter@gmail.com>
---
 include/linux/tick.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/linux/tick.h b/include/linux/tick.h
index 1cf4651f09ad..47750ccd1314 100644
--- a/include/linux/tick.h
+++ b/include/linux/tick.h
@@ -7,6 +7,8 @@
 
 #include <linux/clockchips.h>
 #include <linux/irqflags.h>
+#include <linux/jiffies.h>
+#include <linux/ktime.h>
 #include <linux/percpu.h>
 #include <linux/context_tracking_state.h>
 #include <linux/cpumask.h>
-- 
2.53.0

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] tick: Include ktime.h and jiffies.h in linux/tick.h
  2026-07-22  6:21 [PATCH] tick: Include ktime.h and jiffies.h in linux/tick.h Karl Mehltretter
@ 2026-08-08 20:27 ` Karl Mehltretter
  2026-08-10 14:43 ` [tip: timers/urgent] " tip-bot2 for Karl Mehltretter
  1 sibling, 0 replies; 3+ messages in thread
From: Karl Mehltretter @ 2026-08-08 20:27 UTC (permalink / raw)
  To: Anna-Maria Behnsen, Frederic Weisbecker, Ingo Molnar, Thomas Gleixner
  Cc: linux-kernel

On Wed, Jul 22, 2026 at 08:21:41AM +0100, Karl Mehltretter wrote:
> The !CONFIG_NO_HZ_COMMON stubs use ktime_add(), ktime_get() and
> TICK_NSEC, but tick.h includes neither <linux/ktime.h> nor
> <linux/jiffies.h>. Most configurations build only because those
> declarations arrive transitively.

> Include the headers the file actually uses.
> 
> Fixes: 8aa76aa41589 ("ring-buffer: Use a housekeeping CPU to wake up waiters")
> Assisted-by: Codex:gpt-5.6-sol
> Signed-off-by: Karl Mehltretter <kmehltretter@gmail.com>

Friendly ping on this patch.

Thanks,
Karl

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [tip: timers/urgent] tick: Include ktime.h and jiffies.h in linux/tick.h
  2026-07-22  6:21 [PATCH] tick: Include ktime.h and jiffies.h in linux/tick.h Karl Mehltretter
  2026-08-08 20:27 ` Karl Mehltretter
@ 2026-08-10 14:43 ` tip-bot2 for Karl Mehltretter
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot2 for Karl Mehltretter @ 2026-08-10 14:43 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: Karl Mehltretter, Thomas Gleixner, x86, linux-kernel

The following commit has been merged into the timers/urgent branch of tip:

Commit-ID:     45f8dffc0714c3ef49c83e5bba4c56a4499bd5fc
Gitweb:        https://git.kernel.org/tip/45f8dffc0714c3ef49c83e5bba4c56a4499bd5fc
Author:        Karl Mehltretter <kmehltretter@gmail.com>
AuthorDate:    Wed, 22 Jul 2026 08:21:41 +02:00
Committer:     Thomas Gleixner <tglx@kernel.org>
CommitterDate: Mon, 10 Aug 2026 16:38:33 +02:00

tick: Include ktime.h and jiffies.h in linux/tick.h

The !CONFIG_NO_HZ_COMMON stubs use ktime_add(), ktime_get() and TICK_NSEC,
but tick.h includes neither <linux/ktime.h> nor <linux/jiffies.h>. Most
configurations build only because those declarations arrive transitively.

Commit 6440966067dc ("cpuset: Remove cpuset_cpu_is_isolated()") removed
<linux/cpuset.h> from <linux/sched/isolation.h>. The <linux/cpuset.h>
include chain had been satisfying these declarations before <linux/tick.h>
was parsed. Commit 8aa76aa41589 ("ring-buffer: Use a housekeeping CPU to
wake up waiters") then added <linux/sched/isolation.h> to ring_buffer.c
ahead of any header which provides them. Neither change is wrong on its
own: the failure requires both and appeared in v7.0.

ARM rpc_defconfig + CONFIG_FUNCTION_TRACER fails to build:

  $ make ARCH=arm rpc_defconfig
  $ ./scripts/config -e FTRACE -e FUNCTION_TRACER
  $ make ARCH=arm olddefconfig
  $ make ARCH=arm kernel/trace/ring_buffer.o
  In file included from include/linux/sched/isolation.h:6,
                   from kernel/trace/ring_buffer.c:8:
  include/linux/tick.h: In function 'tick_nohz_get_next_hrtimer':
  include/linux/tick.h:156:9: error: implicit declaration of function
      'ktime_add'; did you mean 'size_add'?
  include/linux/tick.h:156:19: error: implicit declaration of function
      'ktime_get'; did you mean 'time_init'?
  include/linux/tick.h:156:32: error: 'TICK_NSEC' undeclared

Include the headers the file actually uses.

Fixes: 8aa76aa41589 ("ring-buffer: Use a housekeeping CPU to wake up waiters")
Signed-off-by: Karl Mehltretter <kmehltretter@gmail.com>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Assisted-by: Codex:gpt-5.6-sol
Link: https://patch.msgid.link/20260722062141.19671-1-kmehltretter@gmail.com
---
 include/linux/tick.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/linux/tick.h b/include/linux/tick.h
index 1cf4651..47750cc 100644
--- a/include/linux/tick.h
+++ b/include/linux/tick.h
@@ -7,6 +7,8 @@
 
 #include <linux/clockchips.h>
 #include <linux/irqflags.h>
+#include <linux/jiffies.h>
+#include <linux/ktime.h>
 #include <linux/percpu.h>
 #include <linux/context_tracking_state.h>
 #include <linux/cpumask.h>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-08-10 14:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-22  6:21 [PATCH] tick: Include ktime.h and jiffies.h in linux/tick.h Karl Mehltretter
2026-08-08 20:27 ` Karl Mehltretter
2026-08-10 14:43 ` [tip: timers/urgent] " tip-bot2 for Karl Mehltretter

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®