Skip to contentSkip to conversation

sched.h modernization -v2, phase #4: "Remove header dependencies"

PATCH New Ingo Molnar 1 participant 36 messages Feb 8, 2017

Subsystems (8)
lore
Share & tools
lore

Ingo Molnar

author maintainer
#0 lore raw

cover sched.h modernization -v2, phase #4: "Remove header dependencies"

This is phase #4 of the sched.h modernization series.

These remove header #include lines and remove prototypes and thus shrink the header dependency graph monotonically to the desired end result. These are small patches but most breakage will likely bisect to these, so their finegrained split-up is useful as well.

See the announcement for more details:

https://lkml.org/lkml/2017/2/8/564

The Git tree can be found at:

git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git WIP.sched/core

Thanks,

Ingo

Ingo Molnar (35):
sched/headers: Remove <linux/sched.h> from <linux/sched/topology.h> sched/headers: Remove tsk_is_polling()
sched/headers: Remove <linux/sched.h> from <linux/sched/wake_q.h> sched/headers: Remove <linux/sched.h> from <linux/sched/clock.h> sched/headers: Remove <linux/sched.h> and <linux/slab.h> from <linux/delayacct.h> sched/headers: Remove <linux/sched.h> from <linux/sched/loadavg.h> sched/headers: Remove <linux/sched.h> from <linux/sched/autogroup.h> sched/headers: Remove <linux/sched.h> from <linux/sched/mm.h> sched/headers: Remove <linux/sched.h> from <linux/sched/coredump.h> sched/headers: Remove unused 'task_can_switch_user()' prototype sched/headers: Remove <linux/sched.h> from <linux/sched/user.h> sched/headers: Remove #include <linux/capability.h> from <linux/sched.h> sched/headers: Remove <linux/cgroup-defs.h> from <linux/sched.h> sched/headers: Remove <linux/sched.h> from <linux/sched/cpufreq.h> kasan, sched/headers: Remove <linux/sched.h> from <linux/kasan.h> sched/headers: Remove <linux/cred.h> inclusion from <linux/sched.h> sched/headers: Remove <asm/ptrace.h> from <linux/sched.h> sched/headers: Remove <linux/rtmutex.h> from <linux/sched.h> sched/headers: Remove the <linux/gfp.h> include from <linux/sched.h> sched/headers: Remove <linux/sched.h> from <linux/sched/stat.h> sched/headers: Remove <linux/sched.h> from <linux/sched/nohz.h> sched/headers: Remove <linux/sched.h> from <linux/sched/debug.h> sched/headers: Remove <linux/sched.h> from <linux/sched/hotplug.h> sched/headers: Remove the runqueue_is_locked() prototype sched/headers: Remove <linux/rwsem.h> from <linux/sched.h> sched/headers: Remove <linux/signal.h> from <linux/sched.h> sched/headers: Remove the 'init_pid_ns' prototype from <linux/sched.h> sched/headers: Remove <linux/rculist.h> from <linux/sched.h> sched/core: Remove unused prefetch_stack()
sched/headers: Remove <linux/sched.h> from <linux/sched/init.h> sched/headers: Remove <linux/magic.h> from <linux/sched/task_stack.h> sched/headers, timers: Remove the <linux/sysctl.h> include from <linux/timer.h> sched/headers, x86/apic: Remove the <linux/pm.h> header inclusion from <asm/apic.h> sched/headers, hrtimer: Remove the <linux/wait.h> include from <linux/hrtimer.h> sched/headers: Remove the <linux/topology.h> include from <linux/sched.h>

 arch/ia64/include/asm/processor.h |  2 --
 arch/ia64/kernel/entry.S          | 23 -----------------------
 arch/x86/include/asm/apic.h       |  1 -
 include/linux/delayacct.h         |  2 --
 include/linux/hrtimer.h           |  1 -
 include/linux/kasan.h             |  1 -
 include/linux/sched.h             | 32 ++------------------------------
 include/linux/sched/autogroup.h   |  3 +--
 include/linux/sched/clock.h       |  2 +-
 include/linux/sched/coredump.h    |  1 -
 include/linux/sched/cpufreq.h     |  2 +-
 include/linux/sched/debug.h       |  2 --
 include/linux/sched/hotplug.h     |  2 --
 include/linux/sched/idle.h        |  5 -----
 include/linux/sched/init.h        |  2 --
 include/linux/sched/loadavg.h     |  2 --
 include/linux/sched/mm.h          |  2 ++
 include/linux/sched/nohz.h        |  2 --
 include/linux/sched/stat.h        |  2 +-
 include/linux/sched/topology.h    |  7 ++++++-
 include/linux/sched/user.h        |  3 ++-
 include/linux/sched/wake_q.h      |  5 +++--
 include/linux/timer.h             |  2 +-
 include/linux/user_namespace.h    |  2 ++
 include/target/target_core_base.h |  1 +
 kernel/utsname_sysctl.c           |  1 +
 26 files changed, 24 insertions(+), 86 deletions(-)
Signature · 1 line
2.7.4
author maintainer
#1 lore raw

PATCH 1/35 sched/headers: Remove <linux/sched.h> from <linux/sched/topology.h>

The <linux/sched/topology.h> file is a self-contained header and users of it either don't need <linux/sched.h> - or have already included it.

This reduces the size of the header dependency graph.

Cc Linus Torvalds <[email protected]>
Cc Mike Galbraith <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Thomas Gleixner <[email protected]>
---
 include/linux/sched/topology.h | 2 --
 1 file changed, 2 deletions(-)
include/linux/sched/topology.h +0 -2
index b3550b36e65d..0d6fceff37bb 100644
@@ -1,8 +1,6 @@
 #ifndef _LINUX_SCHED_TOPOLOGY_H
 #define _LINUX_SCHED_TOPOLOGY_H
 
-#include <linux/sched.h>
-
 #include <linux/sched/idle.h>
 
 /*
Signature · 1 line
2.7.4
author maintainer
#2 lore raw

PATCH 2/35 sched/headers: Remove tsk_is_polling()

In reply to Ingo Molnar

It's not used by anything.

Cc Linus Torvalds <[email protected]>
Cc Mike Galbraith <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Thomas Gleixner <[email protected]>
---
 include/linux/sched/idle.h | 5 -----
 1 file changed, 5 deletions(-)
include/linux/sched/idle.h +0 -5
index 66ee32f87f0b..5ca63ebad6b4 100644
@@ -17,10 +17,6 @@ extern void wake_up_if_idle(int cpu);
  * polling state.
  */
 #ifdef TIF_POLLING_NRFLAG
-static inline int tsk_is_polling(struct task_struct *p)
-{
-	return test_tsk_thread_flag(p, TIF_POLLING_NRFLAG);
-}
 
 static inline void __current_set_polling(void)
 {
@@ -59,7 +55,6 @@ static inline bool __must_check current_clr_polling_and_test(void)
 }
 
 #else
-static inline int tsk_is_polling(struct task_struct *p) { return 0; }
 static inline void __current_set_polling(void) { }
 static inline void __current_clr_polling(void) { }
 
Signature · 1 line
2.7.4
author maintainer
#3 lore raw

PATCH 3/35 sched/headers: Remove <linux/sched.h> from <linux/sched/wake_q.h>

In reply to Ingo Molnar

After adding a 'struct task_struct' predeclaration the <linux/sched/wake_q.h> file becomes a self-contained header and users of it either don't need <linux/sched.h> - or have already included it.

This reduces the size of the header dependency graph.

Cc Linus Torvalds <[email protected]>
Cc Mike Galbraith <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Thomas Gleixner <[email protected]>
---
 include/linux/sched/wake_q.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
include/linux/sched/wake_q.h +3 -2
index ed66823e845b..e6774a0385fb 100644
@@ -1,8 +1,6 @@
 #ifndef _LINUX_SCHED_WAKE_Q_H
 #define _LINUX_SCHED_WAKE_Q_H
 
-#include <linux/sched.h>
-
 /*
  * Wake-queues are lists of tasks with a pending wakeup, whose
  * callers have already marked the task as woken internally,
@@ -29,6 +27,9 @@
  * must ensure the call is done inside a loop, confirming that the
  * wakeup condition has in fact occurred.
  */
+
+struct task_struct;
+
 struct wake_q_node {
 	struct wake_q_node *next;
 };
Signature · 1 line
2.7.4
author maintainer
#4 lore raw

PATCH 4/35 sched/headers: Remove <linux/sched.h> from <linux/sched/clock.h>

In reply to Ingo Molnar

The <linux/sched/clock.h> file is a largely self-contained header and users of it either don't need <linux/sched.h> - or have already included it.

This reduces the size of the header dependency graph.

Cc Linus Torvalds <[email protected]>
Cc Mike Galbraith <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Thomas Gleixner <[email protected]>
---
 include/linux/sched/clock.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/sched/clock.h +1 -1
index ac12f71d359c..4a68c6791207 100644
@@ -1,7 +1,7 @@
 #ifndef _LINUX_SCHED_CLOCK_H
 #define _LINUX_SCHED_CLOCK_H
 
-#include <linux/sched.h>
+#include <linux/smp.h>
 
 /*
  * Do not use outside of architecture code which knows its limitations.
Signature · 1 line
2.7.4
author maintainer
#5 lore raw

PATCH 5/35 sched/headers: Remove <linux/sched.h> and <linux/slab.h> from <linux/delayacct.h>

In reply to Ingo Molnar

The <linux/delayacct.h> file is a self-contained header and users of it either don't need <linux/sched.h> and <linux/slab.h> - or have already included it.

This reduces the size of the header dependency graph.

Cc Linus Torvalds <[email protected]>
Cc Mike Galbraith <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Thomas Gleixner <[email protected]>
---
 include/linux/delayacct.h | 2 --
 1 file changed, 2 deletions(-)
include/linux/delayacct.h +0 -2
index 6b769cbd1000..4178d2493547 100644
@@ -18,8 +18,6 @@
 #define _LINUX_DELAYACCT_H
 
 #include <uapi/linux/taskstats.h>
-#include <linux/sched.h>
-#include <linux/slab.h>
 
 /*
  * Per-task flags relevant to delay accounting
Signature · 1 line
2.7.4
author maintainer
#6 lore raw

PATCH 6/35 sched/headers: Remove <linux/sched.h> from <linux/sched/loadavg.h>

In reply to Ingo Molnar

The <linux/sched/loadavg.h> file is a self-contained header and users of it either don't need <linux/sched.h> - or have already included it.

This reduces the size of the header dependency graph.

Cc Linus Torvalds <[email protected]>
Cc Mike Galbraith <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Thomas Gleixner <[email protected]>
---
 include/linux/sched/loadavg.h | 2 --
 1 file changed, 2 deletions(-)
include/linux/sched/loadavg.h +0 -2
index c392e28ce0ac..4264bc6b2c27 100644
@@ -1,8 +1,6 @@
 #ifndef _LINUX_SCHED_LOADAVG_H
 #define _LINUX_SCHED_LOADAVG_H
 
-#include <linux/sched.h>
-
 /*
  * These are the constant used to fake the fixed-point load-average
  * counting. Some notes:
Signature · 1 line
2.7.4
author maintainer
#7 lore raw

PATCH 7/35 sched/headers: Remove <linux/sched.h> from <linux/sched/autogroup.h>

In reply to Ingo Molnar

The <linux/sched/autogroup.h> file is a largely self-contained header and users of it either don't need <linux/sched.h> - or have already included it.

Add a 'task_struct' predeclaration to make it build standalone.

This reduces the size of the header dependency graph.

Cc Linus Torvalds <[email protected]>
Cc Mike Galbraith <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Thomas Gleixner <[email protected]>
---
 include/linux/sched/autogroup.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
include/linux/sched/autogroup.h +1 -2
index fd6855548d0c..55cd496df884 100644
@@ -1,9 +1,8 @@
 #ifndef _LINUX_SCHED_AUTOGROUP_H
 #define _LINUX_SCHED_AUTOGROUP_H
 
-#include <linux/sched.h>
-
 struct signal_struct;
+struct task_struct;
 struct task_group;
 struct seq_file;
 
Signature · 1 line
2.7.4
author maintainer
#8 lore raw

PATCH 8/35 sched/headers: Remove <linux/sched.h> from <linux/sched/mm.h>

In reply to Ingo Molnar

The <linux/sched/mm.h> file is a self-contained header and users of it either don't need <linux/sched.h> - or have already included it.

Include kernel.h and atomic.h.

This reduces the size of the header dependency graph.

Cc Linus Torvalds <[email protected]>
Cc Mike Galbraith <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Thomas Gleixner <[email protected]>
---
 include/linux/sched/mm.h | 2 ++
 1 file changed, 2 insertions(+)
include/linux/sched/mm.h +2 -0
index 5eba3890d00e..522a1aa070a3 100644
@@ -1,6 +1,8 @@
 #ifndef _LINUX_SCHED_MM_H
 #define _LINUX_SCHED_MM_H
 
+#include <linux/kernel.h>
+#include <linux/atomic.h>
 #include <linux/sched.h>
 #include <linux/mm_types.h>
 #include <linux/gfp.h>
Signature · 1 line
2.7.4
author maintainer
#9 lore raw

PATCH 9/35 sched/headers: Remove <linux/sched.h> from <linux/sched/coredump.h>

In reply to Ingo Molnar

The <linux/sched/coredump.h> file is a self-contained header and users of it either don't need <linux/sched.h> - or have already included it.

Include <linux/mm_types.h>.

This reduces the size of the header dependency graph.

Cc Linus Torvalds <[email protected]>
Cc Mike Galbraith <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Thomas Gleixner <[email protected]>
---
 include/linux/sched/coredump.h | 1 -
 1 file changed, 1 deletion(-)
include/linux/sched/coredump.h +0 -1
index f46912aa4f4c..69eedcef8f03 100644
@@ -1,7 +1,6 @@
 #ifndef _LINUX_SCHED_COREDUMP_H
 #define _LINUX_SCHED_COREDUMP_H
 
-#include <linux/sched.h>
 #include <linux/mm_types.h>
 
 #define SUID_DUMP_DISABLE	0	/* No setuid dumping */
Signature · 1 line
2.7.4
author maintainer
#10 lore raw

PATCH 10/35 sched/headers: Remove unused 'task_can_switch_user()' prototype

In reply to Ingo Molnar

The function does not exist anymore.

Cc Linus Torvalds <[email protected]>
Cc Mike Galbraith <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Thomas Gleixner <[email protected]>
---
 include/linux/sched.h | 3 ---
 1 file changed, 3 deletions(-)
include/linux/sched.h +0 -3
index 814f7c731e9f..dc0c024333e2 100644
@@ -1505,9 +1505,6 @@ static inline void set_task_cpu(struct task_struct *p, unsigned int cpu)
 extern long sched_setaffinity(pid_t pid, const struct cpumask *new_mask);
 extern long sched_getaffinity(pid_t pid, struct cpumask *mask);
 
-extern int task_can_switch_user(struct user_struct *up,
-					struct task_struct *tsk);
-
 #ifndef TASK_SIZE_OF
 #define TASK_SIZE_OF(tsk)	TASK_SIZE
 #endif
Signature · 1 line
2.7.4
author maintainer
#11 lore raw

PATCH 11/35 sched/headers: Remove <linux/sched.h> from <linux/sched/user.h>

In reply to Ingo Molnar

If we add <linux/uidgid.h> then <linux/sched/user.h> becomes a self-contained header and users of it either don't need <linux/sched.h> or have already included it.

This reduces the size of the header dependency graph.

Cc Linus Torvalds <[email protected]>
Cc Mike Galbraith <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Thomas Gleixner <[email protected]>
---
 include/linux/sched/user.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
include/linux/sched/user.h +2 -1
index c3824e6780e5..47600dd62ded 100644
@@ -1,7 +1,8 @@
 #ifndef _LINUX_SCHED_USER_H
 #define _LINUX_SCHED_USER_H
 
-#include <linux/sched.h>
+#include <linux/uidgid.h>
+#include <linux/atomic.h>
 
 struct key;
 
Signature · 1 line
2.7.4
author maintainer
#12 lore raw

PATCH 12/35 sched/headers: Remove #include <linux/capability.h> from <linux/sched.h>

In reply to Ingo Molnar

The <linux/sched.h> header does not actually make use of any types or APIs defined in <linux/capability.h>, so remove its inclusion.

Cc Linus Torvalds <[email protected]>
Cc Mike Galbraith <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Thomas Gleixner <[email protected]>
---
 include/linux/sched.h | 1 -
 1 file changed, 1 deletion(-)
include/linux/sched.h +0 -1
index dc0c024333e2..117b7661b982 100644
@@ -5,7 +5,6 @@
 
 #include <linux/sched/prio.h>
 
-#include <linux/capability.h>
 #include <linux/mutex.h>
 #include <linux/plist.h>
 #include <linux/mm_types_task.h>
Signature · 1 line
2.7.4
author maintainer
#13 lore raw

PATCH 13/35 sched/headers: Remove <linux/cgroup-defs.h> from <linux/sched.h>

In reply to Ingo Molnar

It's not used by anything in <linux/sched.h> anymore.

This reduces the preprocessed size of <linux/sched.h> and speeds up the build a bit.

Also fix code that implicitly relied on headers included by <linux/cgroup-defs.h>.

Cc Linus Torvalds <[email protected]>
Cc Mike Galbraith <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Thomas Gleixner <[email protected]>
---
 include/linux/sched.h             | 1 -
 include/target/target_core_base.h | 1 +
 2 files changed, 1 insertion(+), 1 deletion(-)
include/linux/sched.h +0 -1
index 117b7661b982..891ed527ce7b 100644
@@ -28,7 +28,6 @@
 #include <linux/gfp.h>
 #include <linux/topology.h>
 #include <linux/magic.h>
-#include <linux/cgroup-defs.h>
 
 #include <asm/current.h>
 
include/target/target_core_base.h +1 -0
index 6762af126cbc..d5d2e3223e6c 100644
@@ -4,6 +4,7 @@
 #include <linux/configfs.h>      /* struct config_group */
 #include <linux/dma-direction.h> /* enum dma_data_direction */
 #include <linux/percpu_ida.h>    /* struct percpu_ida */
+#include <linux/percpu-refcount.h>
 #include <linux/semaphore.h>     /* struct semaphore */
 #include <linux/completion.h>
 
Signature · 1 line
2.7.4
author maintainer
#14 lore raw

PATCH 14/35 sched/headers: Remove <linux/sched.h> from <linux/sched/cpufreq.h>

In reply to Ingo Molnar

Make the <linux/sched/cpufreq.h> file a self-contained header and remove the <linux/sched.h> dependency: users of it either don't need <linux/sched.h> - or have already included it.

This reduces the size of the header dependency graph.

Cc Linus Torvalds <[email protected]>
Cc Mike Galbraith <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Thomas Gleixner <[email protected]>
---
 include/linux/sched/cpufreq.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/sched/cpufreq.h +1 -1
index 2bdcfbfc4c30..d2be2ccbb372 100644
@@ -1,7 +1,7 @@
 #ifndef _LINUX_SCHED_CPUFREQ_H
 #define _LINUX_SCHED_CPUFREQ_H
 
-#include <linux/sched.h>
+#include <linux/types.h>
 
 /*
  * Interface between cpufreq drivers and the scheduler:
Signature · 1 line
2.7.4
author maintainer
#15 lore raw

PATCH 15/35 kasan, sched/headers: Remove <linux/sched.h> from <linux/kasan.h>

In reply to Ingo Molnar

<linux/kasan.h> is a low level header that is included early in affected kernel headers. But it includes <linux/sched.h> which complicates the cleanup of sched.h dependencies.

Remove it.

Cc Linus Torvalds <[email protected]>
Cc Mike Galbraith <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Thomas Gleixner <[email protected]>
---
 include/linux/kasan.h | 1 -
 1 file changed, 1 deletion(-)
include/linux/kasan.h +0 -1
index 96ef4c33148d..42ee86cfbfc8 100644
@@ -1,7 +1,6 @@
 #ifndef _LINUX_KASAN_H
 #define _LINUX_KASAN_H
 
-#include <linux/sched.h>
 #include <linux/types.h>
 
 struct kmem_cache;
Signature · 1 line
2.7.4
author maintainer
#16 lore raw

PATCH 16/35 sched/headers: Remove <linux/cred.h> inclusion from <linux/sched.h>

In reply to Ingo Molnar

This reduces header dependencies and speeds up the build.

Cc Linus Torvalds <[email protected]>
Cc Mike Galbraith <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Thomas Gleixner <[email protected]>
---
 include/linux/sched.h | 1 -
 1 file changed, 1 deletion(-)
include/linux/sched.h +0 -1
index 891ed527ce7b..fce27dc4bee3 100644
@@ -24,7 +24,6 @@
 #include <linux/kcov.h>
 #include <linux/task_io_accounting.h>
 #include <linux/latencytop.h>
-#include <linux/cred.h>
 #include <linux/gfp.h>
 #include <linux/topology.h>
 #include <linux/magic.h>
Signature · 1 line
2.7.4
author maintainer
#17 lore raw

PATCH 17/35 sched/headers: Remove <asm/ptrace.h> from <linux/sched.h>

In reply to Ingo Molnar

This reduces header dependencies.

Cc Linus Torvalds <[email protected]>
Cc Mike Galbraith <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Thomas Gleixner <[email protected]>
---
 include/linux/sched.h | 1 -
 1 file changed, 1 deletion(-)
include/linux/sched.h +0 -1
index fce27dc4bee3..2b737e6996a3 100644
@@ -8,7 +8,6 @@
 #include <linux/mutex.h>
 #include <linux/plist.h>
 #include <linux/mm_types_task.h>
-#include <asm/ptrace.h>
 
 #include <linux/sem.h>
 #include <linux/shm.h>
Signature · 1 line
2.7.4
author maintainer
#18 lore raw

PATCH 18/35 sched/headers: Remove <linux/rtmutex.h> from <linux/sched.h>

In reply to Ingo Molnar

This reduces header dependencies.

Cc Linus Torvalds <[email protected]>
Cc Mike Galbraith <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Thomas Gleixner <[email protected]>
---
 include/linux/sched.h | 1 -
 1 file changed, 1 deletion(-)
include/linux/sched.h +0 -1
index 2b737e6996a3..34a388af9606 100644
@@ -16,7 +16,6 @@
 #include <linux/pid.h>
 #include <linux/seccomp.h>
 #include <linux/rculist.h>
-#include <linux/rtmutex.h>
 
 #include <linux/resource.h>
 #include <linux/hrtimer.h>
Signature · 1 line
2.7.4
author maintainer
#19 lore raw

PATCH 19/35 sched/headers: Remove the <linux/gfp.h> include from <linux/sched.h>

In reply to Ingo Molnar

This reduces sched.h header dependencies.

Cc Linus Torvalds <[email protected]>
Cc Mike Galbraith <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Thomas Gleixner <[email protected]>
---
 include/linux/sched.h | 1 -
 1 file changed, 1 deletion(-)
include/linux/sched.h +0 -1
index 34a388af9606..45a4d10dffd1 100644
@@ -22,7 +22,6 @@
 #include <linux/kcov.h>
 #include <linux/task_io_accounting.h>
 #include <linux/latencytop.h>
-#include <linux/gfp.h>
 #include <linux/topology.h>
 #include <linux/magic.h>
 
Signature · 1 line
2.7.4
author maintainer
#20 lore raw

PATCH 20/35 sched/headers: Remove <linux/sched.h> from <linux/sched/stat.h>

In reply to Ingo Molnar

The <linux/sched/stat.h> file is a largely self-contained header and users of it either don't need <linux/sched.h> - or have already included it.

( Keep the <linux/percpu.h> dependency.)

This reduces the size of the header dependency graph.

Cc Linus Torvalds <[email protected]>
Cc Mike Galbraith <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Thomas Gleixner <[email protected]>
---
 include/linux/sched/stat.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/sched/stat.h +1 -1
index d8cedf27083e..141b74c53fad 100644
@@ -1,7 +1,7 @@
 #ifndef _LINUX_SCHED_STAT_H
 #define _LINUX_SCHED_STAT_H
 
-#include <linux/sched.h>
+#include <linux/percpu.h>
 
 /*
  * Various counters maintained by the scheduler and fork(),
Signature · 1 line
2.7.4
author maintainer
#21 lore raw

PATCH 21/35 sched/headers: Remove <linux/sched.h> from <linux/sched/nohz.h>

In reply to Ingo Molnar

The <linux/sched/nohz.h> file is a self-contained header and users of it either don't need <linux/sched.h> - or have already included it.

This reduces the size of the header dependency graph.

Cc Linus Torvalds <[email protected]>
Cc Mike Galbraith <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Thomas Gleixner <[email protected]>
---
 include/linux/sched/nohz.h | 2 --
 1 file changed, 2 deletions(-)
include/linux/sched/nohz.h +0 -2
index 9471f0736a3a..4995b717500b 100644
@@ -1,8 +1,6 @@
 #ifndef _LINUX_SCHED_NOHZ_H
 #define _LINUX_SCHED_NOHZ_H
 
-#include <linux/sched.h>
-
 /*
  * This is the interface between the scheduler and nohz/dyntics:
  */
Signature · 1 line
2.7.4
author maintainer
#22 lore raw

PATCH 22/35 sched/headers: Remove <linux/sched.h> from <linux/sched/debug.h>

In reply to Ingo Molnar

The <linux/sched/debug.h> file is a self-contained header and users of it either don't need <linux/sched.h> - or have already included it.

This reduces the size of the header dependency graph.

Cc Linus Torvalds <[email protected]>
Cc Mike Galbraith <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Thomas Gleixner <[email protected]>
---
 include/linux/sched/debug.h | 2 --
 1 file changed, 2 deletions(-)
include/linux/sched/debug.h +0 -2
index 853bbef0b47b..e0eaee54c5a4 100644
@@ -1,8 +1,6 @@
 #ifndef _LINUX_SCHED_DEBUG_H
 #define _LINUX_SCHED_DEBUG_H
 
-#include <linux/sched.h>
-
 /*
  * Various scheduler/task debugging interfaces:
  */
Signature · 1 line
2.7.4
author maintainer
#23 lore raw

PATCH 23/35 sched/headers: Remove <linux/sched.h> from <linux/sched/hotplug.h>

In reply to Ingo Molnar

The <linux/sched/hotplug.h> file is a self-contained header and users of it either don't need <linux/sched.h> - or have already included it.

This reduces the size of the header dependency graph.

Cc Linus Torvalds <[email protected]>
Cc Mike Galbraith <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Thomas Gleixner <[email protected]>
---
 include/linux/sched/hotplug.h | 2 --
 1 file changed, 2 deletions(-)
include/linux/sched/hotplug.h +0 -2
index c608d3c1ddb8..752ac7e628d7 100644
@@ -1,8 +1,6 @@
 #ifndef _LINUX_SCHED_HOTPLUG_H
 #define _LINUX_SCHED_HOTPLUG_H
 
-#include <linux/sched.h>
-
 /*
  * Scheduler interfaces for hotplug CPU support:
  */
Signature · 1 line
2.7.4
author maintainer
#24 lore raw

PATCH 24/35 sched/headers: Remove the runqueue_is_locked() prototype

In reply to Ingo Molnar

Remove the runqueue_is_locked() prototype, the function does not exist anymore.

Cc Linus Torvalds <[email protected]>
Cc Mike Galbraith <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Thomas Gleixner <[email protected]>
---
 include/linux/sched.h | 2 --
 1 file changed, 2 deletions(-)
include/linux/sched.h +0 -2
index 45a4d10dffd1..fa722c4c18a3 100644
@@ -172,8 +172,6 @@ struct uts_namespace;
 
 extern cpumask_var_t cpu_isolated_map;
 
-extern int runqueue_is_locked(int cpu);
-
 extern void scheduler_tick(void);
 
 #define	MAX_SCHEDULE_TIMEOUT	LONG_MAX
Signature · 1 line
2.7.4
author maintainer
#25 lore raw

PATCH 25/35 sched/headers: Remove <linux/rwsem.h> from <linux/sched.h>

In reply to Ingo Molnar

This is a stray header that is not needed by anything in sched.h, so remove it.

Update files that relied on the stray inclusion.

This reduces the size of the header dependency graph.

Cc Linus Torvalds <[email protected]>
Cc Mike Galbraith <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Thomas Gleixner <[email protected]>
---
 include/linux/sched.h          | 2 --
 include/linux/user_namespace.h | 1 +
 kernel/utsname_sysctl.c        | 1 +
 3 files changed, 2 insertions(+), 2 deletions(-)
include/linux/sched.h +0 -2
index fa722c4c18a3..da3847ac3956 100644
@@ -226,8 +226,6 @@ struct task_cputime {
 #define prof_exp	stime
 #define sched_exp	sum_exec_runtime
 
-#include <linux/rwsem.h>
-
 #ifdef CONFIG_SCHED_INFO
 struct sched_info {
 	/* cumulative counters */
include/linux/user_namespace.h +1 -0
index 746ee376e603..b3613ee889d9 100644
@@ -5,6 +5,7 @@
 #include <linux/nsproxy.h>
 #include <linux/ns_common.h>
 #include <linux/sched.h>
+#include <linux/rwsem.h>
 #include <linux/sysctl.h>
 #include <linux/err.h>
 
kernel/utsname_sysctl.c +1 -0
index c8eac43267e9..233cd8fc6910 100644
@@ -14,6 +14,7 @@
 #include <linux/utsname.h>
 #include <linux/sysctl.h>
 #include <linux/wait.h>
+#include <linux/rwsem.h>
 
 #ifdef CONFIG_PROC_SYSCTL
 
Signature · 1 line
2.7.4
author maintainer
#26 lore raw

PATCH 26/35 sched/headers: Remove <linux/signal.h> from <linux/sched.h>

In reply to Ingo Molnar

Instead of including the full <linux/signal.h>, only include the types-only <linux/signal_types.h> header in <linux/sched.h>, to further decouple the scheduler header from the signal headers.

Cc Linus Torvalds <[email protected]>
Cc Mike Galbraith <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Thomas Gleixner <[email protected]>
---
 include/linux/sched.h | 1 -
 1 file changed, 1 deletion(-)
include/linux/sched.h +0 -1
index da3847ac3956..fb6571b3bf1e 100644
@@ -11,7 +11,6 @@
 
 #include <linux/sem.h>
 #include <linux/shm.h>
-#include <linux/signal.h>
 #include <linux/signal_types.h>
 #include <linux/pid.h>
 #include <linux/seccomp.h>
Signature · 1 line
2.7.4
author maintainer
#27 lore raw

PATCH 27/35 sched/headers: Remove the 'init_pid_ns' prototype from <linux/sched.h>

In reply to Ingo Molnar

pid.h already defines it.

Cc Linus Torvalds <[email protected]>
Cc Mike Galbraith <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Thomas Gleixner <[email protected]>
---
 include/linux/sched.h | 2 --
 1 file changed, 2 deletions(-)
include/linux/sched.h +0 -2
index fb6571b3bf1e..d5df0f1860b3 100644
@@ -1297,8 +1297,6 @@ static inline struct thread_info *task_thread_info(struct task_struct *task)
 # define task_thread_info(task)	((struct thread_info *)(task)->stack)
 #endif
 
-extern struct pid_namespace init_pid_ns;
-
 /*
  * find a task by one of its numerical ids
  *
Signature · 1 line
2.7.4
author maintainer
#28 lore raw

PATCH 28/35 sched/headers: Remove <linux/rculist.h> from <linux/sched.h>

In reply to Ingo Molnar

We don't actually need the full rculist.h header anymore, include the smaller rcupdate.h header instead.

Cc Linus Torvalds <[email protected]>
Cc Mike Galbraith <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Thomas Gleixner <[email protected]>
---
 include/linux/sched.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/sched.h +1 -1
index d5df0f1860b3..8e0756f50181 100644
@@ -14,7 +14,7 @@
 #include <linux/signal_types.h>
 #include <linux/pid.h>
 #include <linux/seccomp.h>
-#include <linux/rculist.h>
+#include <linux/rcupdate.h>
 
 #include <linux/resource.h>
 #include <linux/hrtimer.h>
Signature · 1 line
2.7.4
author maintainer
#29 lore raw

PATCH 29/35 sched/core: Remove unused prefetch_stack()

In reply to Ingo Molnar

prefetch_stack() is defined by IA64, but not actually used anywhere anymore.

Remove it.

Cc Linus Torvalds <[email protected]>
Cc Mike Galbraith <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Thomas Gleixner <[email protected]>
---
 arch/ia64/include/asm/processor.h |  2 --
 arch/ia64/kernel/entry.S          | 23 -----------------------
 include/linux/sched.h             |  6 ------
 3 files changed, 31 deletions(-)
arch/ia64/include/asm/processor.h +0 -2
index 03911a336406..26a63d69c599 100644
@@ -19,8 +19,6 @@
 #include <asm/ptrace.h>
 #include <asm/ustack.h>
 
-#define ARCH_HAS_PREFETCH_SWITCH_STACK
-
 #define IA64_NUM_PHYS_STACK_REG	96
 #define IA64_NUM_DBG_REGS	8
 
arch/ia64/kernel/entry.S +0 -23
index 6f27a663177c..e7a716b09350 100644
@@ -455,29 +455,6 @@ GLOBAL_ENTRY(load_switch_stack)
 	br.cond.sptk.many b7
 END(load_switch_stack)
 
-GLOBAL_ENTRY(prefetch_stack)
-	add r14 = -IA64_SWITCH_STACK_SIZE, sp
-	add r15 = IA64_TASK_THREAD_KSP_OFFSET, in0
-	;;
-	ld8 r16 = [r15]				// load next's stack pointer
-	lfetch.fault.excl [r14], 128
-	;;
-	lfetch.fault.excl [r14], 128
-	lfetch.fault [r16], 128
-	;;
-	lfetch.fault.excl [r14], 128
-	lfetch.fault [r16], 128
-	;;
-	lfetch.fault.excl [r14], 128
-	lfetch.fault [r16], 128
-	;;
-	lfetch.fault.excl [r14], 128
-	lfetch.fault [r16], 128
-	;;
-	lfetch.fault [r16], 128
-	br.ret.sptk.many rp
-END(prefetch_stack)
-
 	/*
 	 * Invoke a system call, but do some tracing before and after the call.
 	 * We MUST preserve the current register frame throughout this routine
include/linux/sched.h +0 -6
index 8e0756f50181..2464c3ed55a1 100644
@@ -247,12 +247,6 @@ struct sched_info {
 # define SCHED_FIXEDPOINT_SHIFT	10
 # define SCHED_FIXEDPOINT_SCALE	(1L << SCHED_FIXEDPOINT_SHIFT)
 
-#ifdef ARCH_HAS_PREFETCH_SWITCH_STACK
-extern void prefetch_stack(struct task_struct *t);
-#else
-static inline void prefetch_stack(struct task_struct *t) { }
-#endif
-
 struct load_weight {
 	unsigned long weight;
 	u32 inv_weight;
Signature · 1 line
2.7.4
author maintainer
#30 lore raw

PATCH 30/35 sched/headers: Remove <linux/sched.h> from <linux/sched/init.h>

In reply to Ingo Molnar

The <linux/sched/init.h> file is a self-contained header and users of it either don't need <linux/sched.h> - or have already included it.

This reduces the size of the header dependency graph.

Cc Linus Torvalds <[email protected]>
Cc Mike Galbraith <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Thomas Gleixner <[email protected]>
---
 include/linux/sched/init.h | 2 --
 1 file changed, 2 deletions(-)
include/linux/sched/init.h +0 -2
index f31d16075857..127215045285 100644
@@ -1,8 +1,6 @@
 #ifndef _LINUX_SCHED_INIT_H
 #define _LINUX_SCHED_INIT_H
 
-#include <linux/sched.h>
-
 /*
  * Scheduler init related prototypes:
  */
Signature · 1 line
2.7.4
author maintainer
#31 lore raw

PATCH 31/35 sched/headers: Remove <linux/magic.h> from <linux/sched/task_stack.h>

In reply to Ingo Molnar

It's not used by any of the scheduler methods, but <linux/sched/task_stack.h> needs it to pick up STACK_END_MAGIC.

Cc Linus Torvalds <[email protected]>
Cc Mike Galbraith <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Thomas Gleixner <[email protected]>
---
 include/linux/sched.h | 1 -
 1 file changed, 1 deletion(-)
include/linux/sched.h +0 -1
index 2464c3ed55a1..7aabf53cd697 100644
@@ -22,7 +22,6 @@
 #include <linux/task_io_accounting.h>
 #include <linux/latencytop.h>
 #include <linux/topology.h>
-#include <linux/magic.h>
 
 #include <asm/current.h>
 
Signature · 1 line
2.7.4
author maintainer
#32 lore raw

PATCH 32/35 sched/headers, timers: Remove the <linux/sysctl.h> include from <linux/timer.h>

In reply to Ingo Molnar

So we want to simplify <linux/sched.h>'s header dependencies, but one roadblock of that is <linux/timer.h>'s inclusion of sysctl.h, which brings in other, problematic headers.

Note that timer.h's inclusion of sysctl.h can be avoided if we pre-declare ctl_table - so do that.

Cc Linus Torvalds <[email protected]>
Cc Mike Galbraith <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Thomas Gleixner <[email protected]>
---
 include/linux/timer.h          | 2 +-
 include/linux/user_namespace.h | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)
include/linux/timer.h +1 -1
index 51d601f192d4..6594ca6feb68 100644
@@ -255,7 +255,7 @@ struct hrtimer;
 extern enum hrtimer_restart it_real_fn(struct hrtimer *);
 
 #if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ_COMMON)
-#include <linux/sysctl.h>
+struct ctl_table;
 
 extern unsigned int sysctl_timer_migration;
 int timer_migration_handler(struct ctl_table *table, int write,
include/linux/user_namespace.h +1 -0
index b3613ee889d9..404f6b44cf2b 100644
@@ -5,6 +5,7 @@
 #include <linux/nsproxy.h>
 #include <linux/ns_common.h>
 #include <linux/sched.h>
+#include <linux/workqueue.h>
 #include <linux/rwsem.h>
 #include <linux/sysctl.h>
 #include <linux/err.h>
Signature · 1 line
2.7.4
author maintainer
#33 lore raw

PATCH 33/35 sched/headers, x86/apic: Remove the <linux/pm.h> header inclusion from <asm/apic.h>

In reply to Ingo Molnar

We want to simplify <linux/sched.h>'s header dependencies, but one roadblock to that is <asm/apic.h>'s inclusion of pm.h, which brings in other, problematic headers.

Remove it, as it appears to be entirely spurious, apic.h does not actually make use of any PM facilities.

Cc Linus Torvalds <[email protected]>
Cc Mike Galbraith <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Thomas Gleixner <[email protected]>
---
 arch/x86/include/asm/apic.h | 1 -
 1 file changed, 1 deletion(-)
arch/x86/include/asm/apic.h +0 -1
index 0c5fbc68e82d..95111dcd1283 100644
@@ -2,7 +2,6 @@
 #define _ASM_X86_APIC_H
 
 #include <linux/cpumask.h>
-#include <linux/pm.h>
 
 #include <asm/alternative.h>
 #include <asm/cpufeature.h>
Signature · 1 line
2.7.4
author maintainer
#34 lore raw

PATCH 34/35 sched/headers, hrtimer: Remove the <linux/wait.h> include from <linux/hrtimer.h>

In reply to Ingo Molnar

In our quest to simplify <linux/sched.h>'s header dependencies, remove the <linux/wait.h> inclusion from <linux/hrtimer.h> - which does not appear to be necessary, as hrtimer.h does not use waitqueues.

Cc Linus Torvalds <[email protected]>
Cc Mike Galbraith <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Thomas Gleixner <[email protected]>
---
 include/linux/hrtimer.h | 1 -
 1 file changed, 1 deletion(-)
include/linux/hrtimer.h +0 -1
index cdab81ba29f8..d0a97bebfbd6 100644
@@ -19,7 +19,6 @@
 #include <linux/ktime.h>
 #include <linux/init.h>
 #include <linux/list.h>
-#include <linux/wait.h>
 #include <linux/percpu.h>
 #include <linux/timer.h>
 #include <linux/timerqueue.h>
Signature · 1 line
2.7.4
author maintainer
#35 lore raw

PATCH 35/35 sched/headers: Remove the <linux/topology.h> include from <linux/sched.h>

In reply to Ingo Molnar

It's used only by a single (rarely used) inline function (task_node(p)), which we can move to <linux/sched/topology.h>.

( Add <linux/nodemask.h>, because we rely on that. )

Cc Linus Torvalds <[email protected]>
Cc Mike Galbraith <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Thomas Gleixner <[email protected]>
---
 include/linux/sched.h          | 7 +------
 include/linux/sched/topology.h | 7 +++++++
 2 files changed, 8 insertions(+), 6 deletions(-)
include/linux/sched.h +1 -6
index 7aabf53cd697..4ba491501ddd 100644
@@ -4,6 +4,7 @@
 #include <uapi/linux/sched.h>
 
 #include <linux/sched/prio.h>
+#include <linux/nodemask.h>
 
 #include <linux/mutex.h>
 #include <linux/plist.h>
@@ -21,7 +22,6 @@
 #include <linux/kcov.h>
 #include <linux/task_io_accounting.h>
 #include <linux/latencytop.h>
-#include <linux/topology.h>
 
 #include <asm/current.h>
 
@@ -1450,11 +1450,6 @@ static inline unsigned int task_cpu(const struct task_struct *p)
 #endif
 }
 
-static inline int task_node(const struct task_struct *p)
-{
-	return cpu_to_node(task_cpu(p));
-}
-
 extern void set_task_cpu(struct task_struct *p, unsigned int cpu);
 
 #else
include/linux/sched/topology.h +7 -0
index 0d6fceff37bb..7d065abc7a47 100644
@@ -1,6 +1,8 @@
 #ifndef _LINUX_SCHED_TOPOLOGY_H
 #define _LINUX_SCHED_TOPOLOGY_H
 
+#include <linux/topology.h>
+
 #include <linux/sched/idle.h>
 
 /*
@@ -216,4 +218,9 @@ static inline bool cpus_share_cache(int this_cpu, int that_cpu)
 
 #endif	/* !CONFIG_SMP */
 
+static inline int task_node(const struct task_struct *p)
+{
+	return cpu_to_node(task_cpu(p));
+}
+
 #endif /* _LINUX_SCHED_TOPOLOGY_H */
Signature · 1 line
2.7.4