| From 8e39adf42fb14b94aa54111b6272de4a5f8b78fa Mon Sep 17 00:00:00 2001 |
| From: Paul Gortmaker <paul.gortmaker@windriver.com> |
| Date: Thu, 14 May 2020 12:19:16 -0400 |
| Subject: [PATCH] timers/nohz: fix implicit dependency on "struct rq" |
| MIME-Version: 1.0 |
| Content-Type: text/plain; charset=UTF-8 |
| Content-Transfer-Encoding: 8bit |
| |
| Backports to older v5.x kernels revealed a recently introduced |
| implicit dependency on struct rq that makes the nohz.h header |
| no longer stand alone. This is most easily demonstrated as: |
| |
| $ echo '#include <linux/sched/nohz.h>' > init/main.c |
| $ echo 'void foo(void) {}' >> init/main.c |
| $ make init/main.o |
| CC init/main.o |
| In file included from init/main.c:1:0: |
| ./include/linux/sched/nohz.h:18:35: warning: ‘struct rq’ declared inside parameter list [enabled by default] |
| void calc_load_nohz_remote(struct rq *rq); |
| ^ |
| ./include/linux/sched/nohz.h:18:35: warning: its scope is only this definition or declaration, which is probably not what you want [enabled by default] |
| |
| Fixes: ebc0f83c78a2 ("timers/nohz: Update NOHZ load in remote tick") |
| Cc: Peter Zijlstra <peterz@infradead.org> |
| Cc: Frederic Weisbecker <fweisbec@gmail.com> |
| Cc: Thomas Gleixner <tglx@linutronix.de> |
| Cc: Ingo Molnar <mingo@kernel.org> |
| Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> |
| |
| diff --git a/include/linux/sched/nohz.h b/include/linux/sched/nohz.h |
| index b36f4cf38111..ed6c58fe52fc 100644 |
| --- a/include/linux/sched/nohz.h |
| +++ b/include/linux/sched/nohz.h |
| @@ -6,6 +6,8 @@ |
| * This is the interface between the scheduler and nohz/dynticks: |
| */ |
| |
| +struct rq; |
| + |
| #if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ_COMMON) |
| extern void cpu_load_update_nohz_start(void); |
| extern void cpu_load_update_nohz_stop(void); |
| -- |
| 2.7.4 |
| |