Skip to content

Commit f96eca4

Browse files
committed
sched/headers: Introduce kernel/sched/build_policy.c and build multiple .c files there
Similarly to kernel/sched/build_utility.c, collect all 'scheduling policy' related source code files into kernel/sched/build_policy.c: kernel/sched/idle.c kernel/sched/rt.c kernel/sched/cpudeadline.c kernel/sched/pelt.c kernel/sched/cputime.c kernel/sched/deadline.c With the exception of fair.c, which we continue to build as a separate file for build efficiency and parallelism reasons. Signed-off-by: Ingo Molnar <mingo@kernel.org> Reviewed-by: Peter Zijlstra <peterz@infradead.org>
1 parent 801c141 commit f96eca4

9 files changed

Lines changed: 38 additions & 15 deletions

File tree

kernel/sched/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,5 @@ endif
3030
#
3131
obj-y += core.o
3232
obj-y += fair.o
33+
obj-y += build_policy.o
3334
obj-y += build_utility.o
34-
obj-y += idle.o rt.o deadline.o cputime.o cpudeadline.o pelt.o

kernel/sched/build_policy.c

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// SPDX-License-Identifier: GPL-2.0-only
2+
/*
3+
* These are the scheduling policy related scheduler files, built
4+
* in a single compilation unit for build efficiency reasons.
5+
*
6+
* ( Incidentally, the size of the compilation unit is roughly
7+
* comparable to core.c and fair.c, the other two big
8+
* compilation units. This helps balance build time, while
9+
* coalescing source files to amortize header inclusion
10+
* cost. )
11+
*
12+
* core.c and fair.c are built separately.
13+
*/
14+
15+
#include "sched.h"
16+
#include "pelt.h"
17+
18+
#include "idle.c"
19+
20+
#include "rt.c"
21+
22+
#ifdef CONFIG_SMP
23+
# include "cpudeadline.c"
24+
# include "pelt.c"
25+
#endif
26+
27+
#include "cputime.c"
28+
#include "deadline.c"
29+

kernel/sched/cpudeadline.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
*
77
* Author: Juri Lelli <j.lelli@sssup.it>
88
*/
9-
#include "sched.h"
109

1110
static inline int parent(int i)
1211
{

kernel/sched/cputime.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
/*
33
* Simple CPU accounting cgroup controller
44
*/
5-
#include "sched.h"
65

76
#ifdef CONFIG_IRQ_TIME_ACCOUNTING
87

kernel/sched/deadline.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
* Michael Trimarchi <michael@amarulasolutions.com>,
1616
* Fabio Checconi <fchecconi@gmail.com>
1717
*/
18-
#include "sched.h"
19-
#include "pelt.h"
2018

2119
struct dl_bandwidth def_dl_bandwidth;
2220

kernel/sched/idle.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@
66
* (NOTE: these are not related to SCHED_IDLE batch scheduled
77
* tasks which are handled in sched/fair.c )
88
*/
9-
#include "sched.h"
10-
11-
#include <trace/events/power.h>
129

1310
/* Linker adds these: start and end of __cpuidle functions */
1411
extern char __cpuidle_text_start[], __cpuidle_text_end[];

kernel/sched/pelt.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,6 @@
2424
* Author: Vincent Guittot <vincent.guittot@linaro.org>
2525
*/
2626

27-
#include <linux/sched.h>
28-
#include "sched.h"
29-
#include "pelt.h"
30-
3127
/*
3228
* Approximate:
3329
* val * y^n, where y^32 ~= 0.5 (~1 scheduling period)

kernel/sched/rt.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
* Real-Time Scheduling Class (mapped to the SCHED_FIFO and SCHED_RR
44
* policies)
55
*/
6-
#include "sched.h"
7-
8-
#include "pelt.h"
96

107
int sched_rr_timeslice = RR_TIMESLICE;
118
int sysctl_sched_rr_timeslice = (MSEC_PER_SEC / HZ) * RR_TIMESLICE;

kernel/sched/sched.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include <linux/prctl.h>
1414
#include <linux/ptrace_api.h>
1515
#include <linux/gfp_api.h>
16+
#include <linux/posix-timers.h>
1617
#include <linux/sched/clock.h>
1718
#include <linux/workqueue_api.h>
1819
#include <linux/tick.h>
@@ -113,8 +114,11 @@
113114
#include <linux/cpumask_api.h>
114115
#include <linux/ctype.h>
115116
#include <linux/file.h>
117+
#include <linux/hrtimer_api.h>
118+
#include <linux/interrupt.h>
116119
#include <linux/jiffies.h>
117120
#include <linux/kref_api.h>
121+
#include <linux/ktime_api.h>
118122
#include <linux/lockdep_api.h>
119123
#include <linux/module.h>
120124
#include <linux/mutex_api.h>
@@ -126,12 +130,16 @@
126130
#include <linux/sched/loadavg.h>
127131
#include <linux/sched/mm.h>
128132
#include <linux/sched/rseq_api.h>
133+
#include <linux/sched/signal.h>
129134
#include <linux/seq_file.h>
130135
#include <linux/seqlock.h>
136+
#include <linux/softirq.h>
137+
#include <linux/spinlock_api.h>
131138
#include <linux/syscalls_api.h>
132139
#include <linux/syscalls.h>
133140
#include <linux/topology.h>
134141
#include <linux/types.h>
142+
#include <linux/u64_stats_sync_api.h>
135143
#include <linux/uaccess.h>
136144
#include <linux/wait_api.h>
137145
#include <linux/workqueue_api.h>

0 commit comments

Comments
 (0)