From 391e43da797a96aeb65410281891f6d0b0e9611c Mon Sep 17 00:00:00 2001 From: Peter Zijlstra Date: Tue, 15 Nov 2011 17:14:39 +0100 Subject: [PATCH] sched: Move all scheduler bits into kernel/sched/ There's too many sched*.[ch] files in kernel/, give them their own directory. (No code changed, other than Makefile glue added.) Signed-off-by: Peter Zijlstra Signed-off-by: Ingo Molnar --- kernel/Makefile | 20 +++---------------- kernel/sched/Makefile | 20 +++++++++++++++++++ .../{sched_autogroup.c => sched/auto_group.c} | 0 .../{sched_autogroup.h => sched/auto_group.h} | 0 kernel/{sched_clock.c => sched/clock.c} | 0 kernel/{sched.c => sched/core.c} | 8 ++++---- kernel/{sched_cpupri.c => sched/cpupri.c} | 4 ++-- kernel/{sched_cpupri.h => sched/cpupri.h} | 0 kernel/{sched_debug.c => sched/debug.c} | 2 +- kernel/{sched_fair.c => sched/fair.c} | 0 kernel/{sched_features.h => sched/features.h} | 0 .../{sched_idletask.c => sched/idle_task.c} | 0 kernel/{sched_rt.c => sched/rt.c} | 0 kernel/{ => sched}/sched.h | 8 ++++---- kernel/{sched_stats.c => sched/stats.c} | 0 kernel/{sched_stats.h => sched/stats.h} | 0 .../{sched_stoptask.c => sched/stop_task.c} | 0 17 files changed, 34 insertions(+), 28 deletions(-) create mode 100644 kernel/sched/Makefile rename kernel/{sched_autogroup.c => sched/auto_group.c} (100%) rename kernel/{sched_autogroup.h => sched/auto_group.h} (100%) rename kernel/{sched_clock.c => sched/clock.c} (100%) rename kernel/{sched.c => sched/core.c} (99%) rename kernel/{sched_cpupri.c => sched/cpupri.c} (99%) rename kernel/{sched_cpupri.h => sched/cpupri.h} (100%) rename kernel/{sched_debug.c => sched/debug.c} (99%) rename kernel/{sched_fair.c => sched/fair.c} (100%) rename kernel/{sched_features.h => sched/features.h} (100%) rename kernel/{sched_idletask.c => sched/idle_task.c} (100%) rename kernel/{sched_rt.c => sched/rt.c} (100%) rename kernel/{ => sched}/sched.h (99%) rename kernel/{sched_stats.c => sched/stats.c} (100%) rename kernel/{sched_stats.h => sched/stats.h} (100%) rename kernel/{sched_stoptask.c => sched/stop_task.c} (100%) diff --git a/kernel/Makefile b/kernel/Makefile index 1a4d37d7f39..f70396e5a24 100644 --- a/kernel/Makefile +++ b/kernel/Makefile @@ -9,14 +9,9 @@ obj-y = fork.o exec_domain.o panic.o printk.o \ rcupdate.o extable.o params.o posix-timers.o \ kthread.o wait.o kfifo.o sys_ni.o posix-cpu-timers.o mutex.o \ hrtimer.o rwsem.o nsproxy.o srcu.o semaphore.o \ - notifier.o ksysfs.o sched_clock.o cred.o \ + notifier.o ksysfs.o cred.o \ async.o range.o groups.o -obj-y += sched.o sched_idletask.o sched_fair.o sched_rt.o sched_stoptask.o -obj-$(CONFIG_SCHED_AUTOGROUP) += sched_autogroup.o -obj-$(CONFIG_SCHEDSTATS) += sched_stats.o -obj-$(CONFIG_SCHED_DEBUG) += sched_debug.o - ifdef CONFIG_FUNCTION_TRACER # Do not trace debug files and internal ftrace files CFLAGS_REMOVE_lockdep.o = -pg @@ -24,10 +19,11 @@ CFLAGS_REMOVE_lockdep_proc.o = -pg CFLAGS_REMOVE_mutex-debug.o = -pg CFLAGS_REMOVE_rtmutex-debug.o = -pg CFLAGS_REMOVE_cgroup-debug.o = -pg -CFLAGS_REMOVE_sched_clock.o = -pg CFLAGS_REMOVE_irq_work.o = -pg endif +obj-y += sched/ + obj-$(CONFIG_FREEZER) += freezer.o obj-$(CONFIG_PROFILING) += profile.o obj-$(CONFIG_SYSCTL_SYSCALL_CHECK) += sysctl_check.o @@ -103,7 +99,6 @@ obj-$(CONFIG_TRACING) += trace/ obj-$(CONFIG_X86_DS) += trace/ obj-$(CONFIG_RING_BUFFER) += trace/ obj-$(CONFIG_TRACEPOINTS) += trace/ -obj-$(CONFIG_SMP) += sched_cpupri.o obj-$(CONFIG_IRQ_WORK) += irq_work.o obj-$(CONFIG_CPU_PM) += cpu_pm.o @@ -114,15 +109,6 @@ obj-$(CONFIG_PADATA) += padata.o obj-$(CONFIG_CRASH_DUMP) += crash_dump.o obj-$(CONFIG_JUMP_LABEL) += jump_label.o -ifneq ($(CONFIG_SCHED_OMIT_FRAME_POINTER),y) -# According to Alan Modra , the -fno-omit-frame-pointer is -# needed for x86 only. Why this used to be enabled for all architectures is beyond -# me. I suspect most platforms don't need this, but until we know that for sure -# I turn this off for IA-64 only. Andreas Schwab says it's also needed on m68k -# to get a correct value for the wait-channel (WCHAN in ps). --davidm -CFLAGS_sched.o := $(PROFILING) -fno-omit-frame-pointer -endif - $(obj)/configs.o: $(obj)/config_data.h # config_data.h contains the same information as ikconfig.h but gzipped. diff --git a/kernel/sched/Makefile b/kernel/sched/Makefile new file mode 100644 index 00000000000..9a7dd35102a --- /dev/null +++ b/kernel/sched/Makefile @@ -0,0 +1,20 @@ +ifdef CONFIG_FUNCTION_TRACER +CFLAGS_REMOVE_clock.o = -pg +endif + +ifneq ($(CONFIG_SCHED_OMIT_FRAME_POINTER),y) +# According to Alan Modra , the -fno-omit-frame-pointer is +# needed for x86 only. Why this used to be enabled for all architectures is beyond +# me. I suspect most platforms don't need this, but until we know that for sure +# I turn this off for IA-64 only. Andreas Schwab says it's also needed on m68k +# to get a correct value for the wait-channel (WCHAN in ps). --davidm +CFLAGS_core.o := $(PROFILING) -fno-omit-frame-pointer +endif + +obj-y += core.o clock.o idle_task.o fair.o rt.o stop_task.o +obj-$(CONFIG_SMP) += cpupri.o +obj-$(CONFIG_SCHED_AUTOGROUP) += auto_group.o +obj-$(CONFIG_SCHEDSTATS) += stats.o +obj-$(CONFIG_SCHED_DEBUG) += debug.o + + diff --git a/kernel/sched_autogroup.c b/kernel/sched/auto_group.c similarity index 100% rename from kernel/sched_autogroup.c rename to kernel/sched/auto_group.c diff --git a/kernel/sched_autogroup.h b/kernel/sched/auto_group.h similarity index 100% rename from kernel/sched_autogroup.h rename to kernel/sched/auto_group.h diff --git a/kernel/sched_clock.c b/kernel/sched/clock.c similarity index 100% rename from kernel/sched_clock.c rename to kernel/sched/clock.c diff --git a/kernel/sched.c b/kernel/sched/core.c similarity index 99% rename from kernel/sched.c rename to kernel/sched/core.c index 2ffcceed886..ca8fd44145a 100644 --- a/kernel/sched.c +++ b/kernel/sched/core.c @@ -1,5 +1,5 @@ /* - * kernel/sched.c + * kernel/sched/core.c * * Kernel scheduler and related syscalls * @@ -79,7 +79,7 @@ #endif #include "sched.h" -#include "workqueue_sched.h" +#include "../workqueue_sched.h" #define CREATE_TRACE_POINTS #include @@ -129,7 +129,7 @@ void update_rq_clock(struct rq *rq) (1UL << __SCHED_FEAT_##name) * enabled | const_debug unsigned int sysctl_sched_features = -#include "sched_features.h" +#include "features.h" 0; #undef SCHED_FEAT @@ -139,7 +139,7 @@ const_debug unsigned int sysctl_sched_features = #name , static __read_mostly char *sched_feat_names[] = { -#include "sched_features.h" +#include "features.h" NULL }; diff --git a/kernel/sched_cpupri.c b/kernel/sched/cpupri.c similarity index 99% rename from kernel/sched_cpupri.c rename to kernel/sched/cpupri.c index a86cf9d9eb1..b0d798eaf13 100644 --- a/kernel/sched_cpupri.c +++ b/kernel/sched/cpupri.c @@ -1,5 +1,5 @@ /* - * kernel/sched_cpupri.c + * kernel/sched/cpupri.c * * CPU priority management * @@ -28,7 +28,7 @@ */ #include -#include "sched_cpupri.h" +#include "cpupri.h" /* Convert between a 140 based task->prio, and our 102 based cpupri */ static int convert_prio(int prio) diff --git a/kernel/sched_cpupri.h b/kernel/sched/cpupri.h similarity index 100% rename from kernel/sched_cpupri.h rename to kernel/sched/cpupri.h diff --git a/kernel/sched_debug.c b/kernel/sched/debug.c similarity index 99% rename from kernel/sched_debug.c rename to kernel/sched/debug.c index ce1a85f2ddc..2a075e10004 100644 --- a/kernel/sched_debug.c +++ b/kernel/sched/debug.c @@ -1,5 +1,5 @@ /* - * kernel/time/sched_debug.c + * kernel/sched/debug.c * * Print the CFS rbtree * diff --git a/kernel/sched_fair.c b/kernel/sched/fair.c similarity index 100% rename from kernel/sched_fair.c rename to kernel/sched/fair.c diff --git a/kernel/sched_features.h b/kernel/sched/features.h similarity index 100% rename from kernel/sched_features.h rename to kernel/sched/features.h diff --git a/kernel/sched_idletask.c b/kernel/sched/idle_task.c similarity index 100% rename from kernel/sched_idletask.c rename to kernel/sched/idle_task.c diff --git a/kernel/sched_rt.c b/kernel/sched/rt.c similarity index 100% rename from kernel/sched_rt.c rename to kernel/sched/rt.c diff --git a/kernel/sched.h b/kernel/sched/sched.h similarity index 99% rename from kernel/sched.h rename to kernel/sched/sched.h index 675261ce3c4..c2e780234c3 100644 --- a/kernel/sched.h +++ b/kernel/sched/sched.h @@ -4,7 +4,7 @@ #include #include -#include "sched_cpupri.h" +#include "cpupri.h" extern __read_mostly int scheduler_running; @@ -507,8 +507,8 @@ DECLARE_PER_CPU(struct rq, runqueues); #define cpu_curr(cpu) (cpu_rq(cpu)->curr) #define raw_rq() (&__raw_get_cpu_var(runqueues)) -#include "sched_stats.h" -#include "sched_autogroup.h" +#include "stats.h" +#include "auto_group.h" #ifdef CONFIG_CGROUP_SCHED @@ -590,7 +590,7 @@ extern const_debug unsigned int sysctl_sched_features; __SCHED_FEAT_##name , enum { -#include "sched_features.h" +#include "features.h" }; #undef SCHED_FEAT diff --git a/kernel/sched_stats.c b/kernel/sched/stats.c similarity index 100% rename from kernel/sched_stats.c rename to kernel/sched/stats.c diff --git a/kernel/sched_stats.h b/kernel/sched/stats.h similarity index 100% rename from kernel/sched_stats.h rename to kernel/sched/stats.h diff --git a/kernel/sched_stoptask.c b/kernel/sched/stop_task.c similarity index 100% rename from kernel/sched_stoptask.c rename to kernel/sched/stop_task.c