@@ -11,6 +11,7 @@
#undef CREATE_TRACE_POINTS
#include "sched.h"
+#include "stats.h"
#include <linux/nospec.h>
@@ -16,6 +16,7 @@
* Fabio Checconi <fchecconi@gmail.com>
*/
#include "sched.h"
+#include "stats.h"
#include "pelt.h"
struct dl_bandwidth def_dl_bandwidth;
@@ -7,6 +7,7 @@
* Copyright(C) 2007, Red Hat, Inc., Ingo Molnar
*/
#include "sched.h"
+#include "stats.h"
static DEFINE_SPINLOCK(sched_debug_lock);
@@ -21,6 +21,7 @@
* Copyright (C) 2007 Red Hat, Inc., Peter Zijlstra
*/
#include "sched.h"
+#include "stats.h"
/*
* Targeted preemption latency for CPU-bound tasks:
@@ -7,6 +7,7 @@
* tasks which are handled in sched/fair.c )
*/
#include "sched.h"
+#include "stats.h"
#include <trace/events/power.h>
@@ -4,7 +4,7 @@
* policies)
*/
#include "sched.h"
-
+#include "stats.h"
#include "pelt.h"
int sched_rr_timeslice = RR_TIMESLICE;
@@ -2,6 +2,9 @@
/*
* Scheduler internal types and methods:
*/
+#ifndef _KERNEL_SCHED_SCHED_H
+#define _KERNEL_SCHED_SCHED_H
+
#include <linux/sched.h>
#include <linux/sched/autogroup.h>
@@ -1538,7 +1541,6 @@ extern void flush_smp_call_function_from_idle(void);
static inline void flush_smp_call_function_from_idle(void) { }
#endif
-#include "stats.h"
#include "autogroup.h"
#ifdef CONFIG_CGROUP_SCHED
@@ -2633,3 +2635,5 @@ static inline bool is_per_cpu_kthread(struct task_struct *p)
void swake_up_all_locked(struct swait_queue_head *q);
void __prepare_to_swait(struct swait_queue_head *q, struct swait_queue *wait);
+
+#endif /* _KERNEL_SCHED_SCHED_H */
@@ -3,6 +3,7 @@
* /proc/schedstat implementation
*/
#include "sched.h"
+#include "stats.h"
/*
* Current schedstat API version.
@@ -2,6 +2,8 @@
#ifdef CONFIG_SCHEDSTATS
+#include "sched.h"
+
/*
* Expects runqueue lock to be held for atomicity of update
*/
@@ -8,6 +8,7 @@
* See kernel/stop_machine.c
*/
#include "sched.h"
+#include "stats.h"
#ifdef CONFIG_SMP
static int
This patch is a preparation of the followup patches. In the followup patches some common helpers will be defined in stats.h, and these common helpers require some definitions in sched.h, so let's move stats.h out of sched.h. The source files which require stats.h include it specifically. Signed-off-by: Yafang Shao <laoar.shao@gmail.com> --- kernel/sched/core.c | 1 + kernel/sched/deadline.c | 1 + kernel/sched/debug.c | 1 + kernel/sched/fair.c | 1 + kernel/sched/idle.c | 1 + kernel/sched/rt.c | 2 +- kernel/sched/sched.h | 6 +++++- kernel/sched/stats.c | 1 + kernel/sched/stats.h | 2 ++ kernel/sched/stop_task.c | 1 + 10 files changed, 15 insertions(+), 2 deletions(-)