sched.h modernization -v2, phase #4: "Remove header dependencies"
Subsystems (8)
Ingo Molnar
maintainercover 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
Ingo Molnar
maintainerPATCH 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.
--- include/linux/sched/topology.h | 2 -- 1 file changed, 2 deletions(-)
include/linux/sched/topology.h +0 -2
@@ -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
Ingo Molnar
maintainerPATCH 2/35 sched/headers: Remove tsk_is_polling()
In reply to Ingo MolnarIt's not used by anything.
--- include/linux/sched/idle.h | 5 ----- 1 file changed, 5 deletions(-)
include/linux/sched/idle.h +0 -5
@@ -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
Ingo Molnar
maintainerPATCH 3/35 sched/headers: Remove <linux/sched.h> from <linux/sched/wake_q.h>
In reply to Ingo MolnarAfter 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.
--- include/linux/sched/wake_q.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
include/linux/sched/wake_q.h +3 -2
@@ -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
Ingo Molnar
maintainerPATCH 4/35 sched/headers: Remove <linux/sched.h> from <linux/sched/clock.h>
In reply to Ingo MolnarThe <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.
--- include/linux/sched/clock.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/sched/clock.h +1 -1
@@ -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
Ingo Molnar
maintainerPATCH 5/35 sched/headers: Remove <linux/sched.h> and <linux/slab.h> from <linux/delayacct.h>
In reply to Ingo MolnarThe <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.
--- include/linux/delayacct.h | 2 -- 1 file changed, 2 deletions(-)
include/linux/delayacct.h +0 -2
@@ -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
Ingo Molnar
maintainerPATCH 6/35 sched/headers: Remove <linux/sched.h> from <linux/sched/loadavg.h>
In reply to Ingo MolnarThe <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.
--- include/linux/sched/loadavg.h | 2 -- 1 file changed, 2 deletions(-)
include/linux/sched/loadavg.h +0 -2
@@ -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
Ingo Molnar
maintainerPATCH 7/35 sched/headers: Remove <linux/sched.h> from <linux/sched/autogroup.h>
In reply to Ingo MolnarThe <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.
--- include/linux/sched/autogroup.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
include/linux/sched/autogroup.h +1 -2
@@ -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
Ingo Molnar
maintainerPATCH 8/35 sched/headers: Remove <linux/sched.h> from <linux/sched/mm.h>
In reply to Ingo MolnarThe <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.
--- include/linux/sched/mm.h | 2 ++ 1 file changed, 2 insertions(+)
include/linux/sched/mm.h +2 -0
@@ -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
Ingo Molnar
maintainerPATCH 9/35 sched/headers: Remove <linux/sched.h> from <linux/sched/coredump.h>
In reply to Ingo MolnarThe <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.
--- include/linux/sched/coredump.h | 1 - 1 file changed, 1 deletion(-)
include/linux/sched/coredump.h +0 -1
@@ -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
Ingo Molnar
maintainerPATCH 10/35 sched/headers: Remove unused 'task_can_switch_user()' prototype
In reply to Ingo MolnarThe function does not exist anymore.
--- include/linux/sched.h | 3 --- 1 file changed, 3 deletions(-)
include/linux/sched.h +0 -3
@@ -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
Ingo Molnar
maintainerPATCH 11/35 sched/headers: Remove <linux/sched.h> from <linux/sched/user.h>
In reply to Ingo MolnarIf 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.
--- include/linux/sched/user.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
include/linux/sched/user.h +2 -1
@@ -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
Ingo Molnar
maintainerPATCH 12/35 sched/headers: Remove #include <linux/capability.h> from <linux/sched.h>
In reply to Ingo MolnarThe <linux/sched.h> header does not actually make use of any types or APIs defined in <linux/capability.h>, so remove its inclusion.
--- include/linux/sched.h | 1 - 1 file changed, 1 deletion(-)
include/linux/sched.h +0 -1
@@ -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
Ingo Molnar
maintainerPATCH 13/35 sched/headers: Remove <linux/cgroup-defs.h> from <linux/sched.h>
In reply to Ingo MolnarIt'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>.
--- 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
@@ -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
@@ -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
Ingo Molnar
maintainerPATCH 14/35 sched/headers: Remove <linux/sched.h> from <linux/sched/cpufreq.h>
In reply to Ingo MolnarMake 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.
--- include/linux/sched/cpufreq.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/sched/cpufreq.h +1 -1
@@ -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
Ingo Molnar
maintainerPATCH 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.
--- include/linux/kasan.h | 1 - 1 file changed, 1 deletion(-)
include/linux/kasan.h +0 -1
@@ -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
Ingo Molnar
maintainerPATCH 16/35 sched/headers: Remove <linux/cred.h> inclusion from <linux/sched.h>
In reply to Ingo MolnarThis reduces header dependencies and speeds up the build.
--- include/linux/sched.h | 1 - 1 file changed, 1 deletion(-)
include/linux/sched.h +0 -1
@@ -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
Ingo Molnar
maintainerPATCH 17/35 sched/headers: Remove <asm/ptrace.h> from <linux/sched.h>
In reply to Ingo MolnarThis reduces header dependencies.
--- include/linux/sched.h | 1 - 1 file changed, 1 deletion(-)
include/linux/sched.h +0 -1
@@ -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
Ingo Molnar
maintainerPATCH 18/35 sched/headers: Remove <linux/rtmutex.h> from <linux/sched.h>
In reply to Ingo MolnarThis reduces header dependencies.
--- include/linux/sched.h | 1 - 1 file changed, 1 deletion(-)
include/linux/sched.h +0 -1
@@ -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
Ingo Molnar
maintainerPATCH 19/35 sched/headers: Remove the <linux/gfp.h> include from <linux/sched.h>
In reply to Ingo MolnarThis reduces sched.h header dependencies.
--- include/linux/sched.h | 1 - 1 file changed, 1 deletion(-)
include/linux/sched.h +0 -1
@@ -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
Ingo Molnar
maintainerPATCH 20/35 sched/headers: Remove <linux/sched.h> from <linux/sched/stat.h>
In reply to Ingo MolnarThe <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.
--- include/linux/sched/stat.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/sched/stat.h +1 -1
@@ -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
Ingo Molnar
maintainerPATCH 21/35 sched/headers: Remove <linux/sched.h> from <linux/sched/nohz.h>
In reply to Ingo MolnarThe <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.
--- include/linux/sched/nohz.h | 2 -- 1 file changed, 2 deletions(-)
include/linux/sched/nohz.h +0 -2
@@ -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
Ingo Molnar
maintainerPATCH 22/35 sched/headers: Remove <linux/sched.h> from <linux/sched/debug.h>
In reply to Ingo MolnarThe <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.
--- include/linux/sched/debug.h | 2 -- 1 file changed, 2 deletions(-)
include/linux/sched/debug.h +0 -2
@@ -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
Ingo Molnar
maintainerPATCH 23/35 sched/headers: Remove <linux/sched.h> from <linux/sched/hotplug.h>
In reply to Ingo MolnarThe <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.
--- include/linux/sched/hotplug.h | 2 -- 1 file changed, 2 deletions(-)
include/linux/sched/hotplug.h +0 -2
@@ -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
Ingo Molnar
maintainerPATCH 24/35 sched/headers: Remove the runqueue_is_locked() prototype
In reply to Ingo MolnarRemove the runqueue_is_locked() prototype, the function does not exist anymore.
--- include/linux/sched.h | 2 -- 1 file changed, 2 deletions(-)
include/linux/sched.h +0 -2
@@ -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
Ingo Molnar
maintainerPATCH 25/35 sched/headers: Remove <linux/rwsem.h> from <linux/sched.h>
In reply to Ingo MolnarThis 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.
--- 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
@@ -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
@@ -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
@@ -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
Ingo Molnar
maintainerPATCH 26/35 sched/headers: Remove <linux/signal.h> from <linux/sched.h>
In reply to Ingo MolnarInstead 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.
--- include/linux/sched.h | 1 - 1 file changed, 1 deletion(-)
include/linux/sched.h +0 -1
@@ -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
Ingo Molnar
maintainerPATCH 27/35 sched/headers: Remove the 'init_pid_ns' prototype from <linux/sched.h>
In reply to Ingo Molnarpid.h already defines it.
--- include/linux/sched.h | 2 -- 1 file changed, 2 deletions(-)
include/linux/sched.h +0 -2
@@ -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
Ingo Molnar
maintainerPATCH 28/35 sched/headers: Remove <linux/rculist.h> from <linux/sched.h>
In reply to Ingo MolnarWe don't actually need the full rculist.h header anymore, include the smaller rcupdate.h header instead.
--- include/linux/sched.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/sched.h +1 -1
@@ -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
Ingo Molnar
maintainerPATCH 29/35 sched/core: Remove unused prefetch_stack()
In reply to Ingo Molnarprefetch_stack() is defined by IA64, but not actually used anywhere anymore.
Remove it.
--- 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
@@ -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
@@ -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
@@ -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
Ingo Molnar
maintainerPATCH 30/35 sched/headers: Remove <linux/sched.h> from <linux/sched/init.h>
In reply to Ingo MolnarThe <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.
--- include/linux/sched/init.h | 2 -- 1 file changed, 2 deletions(-)
include/linux/sched/init.h +0 -2
@@ -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
Ingo Molnar
maintainerPATCH 31/35 sched/headers: Remove <linux/magic.h> from <linux/sched/task_stack.h>
In reply to Ingo MolnarIt's not used by any of the scheduler methods, but <linux/sched/task_stack.h> needs it to pick up STACK_END_MAGIC.
--- include/linux/sched.h | 1 - 1 file changed, 1 deletion(-)
include/linux/sched.h +0 -1
@@ -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
Ingo Molnar
maintainerPATCH 32/35 sched/headers, timers: Remove the <linux/sysctl.h> include from <linux/timer.h>
In reply to Ingo MolnarSo 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.
--- include/linux/timer.h | 2 +- include/linux/user_namespace.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-)
include/linux/timer.h +1 -1
@@ -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
@@ -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
Ingo Molnar
maintainerPATCH 33/35 sched/headers, x86/apic: Remove the <linux/pm.h> header inclusion from <asm/apic.h>
In reply to Ingo MolnarWe 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.
--- arch/x86/include/asm/apic.h | 1 - 1 file changed, 1 deletion(-)
arch/x86/include/asm/apic.h +0 -1
@@ -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
Ingo Molnar
maintainerPATCH 34/35 sched/headers, hrtimer: Remove the <linux/wait.h> include from <linux/hrtimer.h>
In reply to Ingo MolnarIn 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.
--- include/linux/hrtimer.h | 1 - 1 file changed, 1 deletion(-)
include/linux/hrtimer.h +0 -1
@@ -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
Ingo Molnar
maintainerPATCH 35/35 sched/headers: Remove the <linux/topology.h> include from <linux/sched.h>
In reply to Ingo MolnarIt'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. )
--- include/linux/sched.h | 7 +------ include/linux/sched/topology.h | 7 +++++++ 2 files changed, 8 insertions(+), 6 deletions(-)
include/linux/sched.h +1 -6
@@ -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
@@ -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