Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

sched: Move sched.h sysctl bits into separate header

Move the sysctl-related bits from include/linux/sched.h into
a new file: include/linux/sched/sysctl.h. Then update source
files requiring access to those bits by including the new
header file.

Signed-off-by: Clark Williams <williams@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Link: http://lkml.kernel.org/r/20130207094659.06dced96@riff.lan
Signed-off-by: Ingo Molnar <mingo@kernel.org>

authored by

Clark Williams and committed by
Ingo Molnar
cf4aebc2 b2c77a57

+106 -91
+1
block/blk-exec.c
··· 5 5 #include <linux/module.h> 6 6 #include <linux/bio.h> 7 7 #include <linux/blkdev.h> 8 + #include <linux/sched/sysctl.h> 8 9 9 10 #include "blk.h" 10 11
-91
include/linux/sched.h
··· 304 304 } 305 305 #endif 306 306 307 - #ifdef CONFIG_DETECT_HUNG_TASK 308 - extern unsigned int sysctl_hung_task_panic; 309 - extern unsigned long sysctl_hung_task_check_count; 310 - extern unsigned long sysctl_hung_task_timeout_secs; 311 - extern unsigned long sysctl_hung_task_warnings; 312 - extern int proc_dohung_task_timeout_secs(struct ctl_table *table, int write, 313 - void __user *buffer, 314 - size_t *lenp, loff_t *ppos); 315 - #else 316 - /* Avoid need for ifdefs elsewhere in the code */ 317 - enum { sysctl_hung_task_timeout_secs = 0 }; 318 - #endif 319 - 320 307 /* Attach to any functions which should be ignored in wchan output. */ 321 308 #define __sched __attribute__((__section__(".sched.text"))) 322 309 ··· 324 337 325 338 struct nsproxy; 326 339 struct user_namespace; 327 - 328 - /* 329 - * Default maximum number of active map areas, this limits the number of vmas 330 - * per mm struct. Users can overwrite this number by sysctl but there is a 331 - * problem. 332 - * 333 - * When a program's coredump is generated as ELF format, a section is created 334 - * per a vma. In ELF, the number of sections is represented in unsigned short. 335 - * This means the number of sections should be smaller than 65535 at coredump. 336 - * Because the kernel adds some informative sections to a image of program at 337 - * generating coredump, we need some margin. The number of extra sections is 338 - * 1-3 now and depends on arch. We use "5" as safe margin, here. 339 - */ 340 - #define MAPCOUNT_ELF_CORE_MARGIN (5) 341 - #define DEFAULT_MAX_MAP_COUNT (USHRT_MAX - MAPCOUNT_ELF_CORE_MARGIN) 342 - 343 - extern int sysctl_max_map_count; 344 340 345 341 #include <linux/aio.h> 346 342 ··· 1191 1221 #endif 1192 1222 }; 1193 1223 1194 - /* 1195 - * default timeslice is 100 msecs (used only for SCHED_RR tasks). 1196 - * Timeslices get refilled after they expire. 1197 - */ 1198 - #define RR_TIMESLICE (100 * HZ / 1000) 1199 - 1200 1224 struct rcu_node; 1201 1225 1202 1226 enum perf_event_task_context { ··· 2038 2074 static inline void wake_up_idle_cpu(int cpu) { } 2039 2075 #endif 2040 2076 2041 - extern unsigned int sysctl_sched_latency; 2042 - extern unsigned int sysctl_sched_min_granularity; 2043 - extern unsigned int sysctl_sched_wakeup_granularity; 2044 - extern unsigned int sysctl_sched_child_runs_first; 2045 - 2046 - enum sched_tunable_scaling { 2047 - SCHED_TUNABLESCALING_NONE, 2048 - SCHED_TUNABLESCALING_LOG, 2049 - SCHED_TUNABLESCALING_LINEAR, 2050 - SCHED_TUNABLESCALING_END, 2051 - }; 2052 - extern enum sched_tunable_scaling sysctl_sched_tunable_scaling; 2053 - 2054 - extern unsigned int sysctl_numa_balancing_scan_delay; 2055 - extern unsigned int sysctl_numa_balancing_scan_period_min; 2056 - extern unsigned int sysctl_numa_balancing_scan_period_max; 2057 - extern unsigned int sysctl_numa_balancing_scan_period_reset; 2058 - extern unsigned int sysctl_numa_balancing_scan_size; 2059 - extern unsigned int sysctl_numa_balancing_settle_count; 2060 - 2061 - #ifdef CONFIG_SCHED_DEBUG 2062 - extern unsigned int sysctl_sched_migration_cost; 2063 - extern unsigned int sysctl_sched_nr_migrate; 2064 - extern unsigned int sysctl_sched_time_avg; 2065 - extern unsigned int sysctl_timer_migration; 2066 - extern unsigned int sysctl_sched_shares_window; 2067 - 2068 - int sched_proc_update_handler(struct ctl_table *table, int write, 2069 - void __user *buffer, size_t *length, 2070 - loff_t *ppos); 2071 - #endif 2072 - #ifdef CONFIG_SCHED_DEBUG 2073 - static inline unsigned int get_sysctl_timer_migration(void) 2074 - { 2075 - return sysctl_timer_migration; 2076 - } 2077 - #else 2078 - static inline unsigned int get_sysctl_timer_migration(void) 2079 - { 2080 - return 1; 2081 - } 2082 - #endif 2083 - extern unsigned int sysctl_sched_rt_period; 2084 - extern int sysctl_sched_rt_runtime; 2085 - 2086 - int sched_rt_handler(struct ctl_table *table, int write, 2087 - void __user *buffer, size_t *lenp, 2088 - loff_t *ppos); 2089 - 2090 2077 #ifdef CONFIG_SCHED_AUTOGROUP 2091 - extern unsigned int sysctl_sched_autogroup_enabled; 2092 - 2093 2078 extern void sched_autogroup_create_attach(struct task_struct *p); 2094 2079 extern void sched_autogroup_detach(struct task_struct *p); 2095 2080 extern void sched_autogroup_fork(struct signal_struct *sig); ··· 2052 2139 static inline void sched_autogroup_detach(struct task_struct *p) { } 2053 2140 static inline void sched_autogroup_fork(struct signal_struct *sig) { } 2054 2141 static inline void sched_autogroup_exit(struct signal_struct *sig) { } 2055 - #endif 2056 - 2057 - #ifdef CONFIG_CFS_BANDWIDTH 2058 - extern unsigned int sysctl_sched_cfs_bandwidth_slice; 2059 2142 #endif 2060 2143 2061 2144 #ifdef CONFIG_RT_MUTEXES
+97
include/linux/sched/sysctl.h
··· 1 + #ifndef _SCHED_SYSCTL_H 2 + #define _SCHED_SYSCTL_H 3 + 4 + #ifdef CONFIG_DETECT_HUNG_TASK 5 + extern unsigned int sysctl_hung_task_panic; 6 + extern unsigned long sysctl_hung_task_check_count; 7 + extern unsigned long sysctl_hung_task_timeout_secs; 8 + extern unsigned long sysctl_hung_task_warnings; 9 + extern int proc_dohung_task_timeout_secs(struct ctl_table *table, int write, 10 + void __user *buffer, 11 + size_t *lenp, loff_t *ppos); 12 + #else 13 + /* Avoid need for ifdefs elsewhere in the code */ 14 + enum { sysctl_hung_task_timeout_secs = 0 }; 15 + #endif 16 + 17 + /* 18 + * Default maximum number of active map areas, this limits the number of vmas 19 + * per mm struct. Users can overwrite this number by sysctl but there is a 20 + * problem. 21 + * 22 + * When a program's coredump is generated as ELF format, a section is created 23 + * per a vma. In ELF, the number of sections is represented in unsigned short. 24 + * This means the number of sections should be smaller than 65535 at coredump. 25 + * Because the kernel adds some informative sections to a image of program at 26 + * generating coredump, we need some margin. The number of extra sections is 27 + * 1-3 now and depends on arch. We use "5" as safe margin, here. 28 + */ 29 + #define MAPCOUNT_ELF_CORE_MARGIN (5) 30 + #define DEFAULT_MAX_MAP_COUNT (USHRT_MAX - MAPCOUNT_ELF_CORE_MARGIN) 31 + 32 + extern int sysctl_max_map_count; 33 + 34 + extern unsigned int sysctl_sched_latency; 35 + extern unsigned int sysctl_sched_min_granularity; 36 + extern unsigned int sysctl_sched_wakeup_granularity; 37 + extern unsigned int sysctl_sched_child_runs_first; 38 + 39 + enum sched_tunable_scaling { 40 + SCHED_TUNABLESCALING_NONE, 41 + SCHED_TUNABLESCALING_LOG, 42 + SCHED_TUNABLESCALING_LINEAR, 43 + SCHED_TUNABLESCALING_END, 44 + }; 45 + extern enum sched_tunable_scaling sysctl_sched_tunable_scaling; 46 + 47 + extern unsigned int sysctl_numa_balancing_scan_delay; 48 + extern unsigned int sysctl_numa_balancing_scan_period_min; 49 + extern unsigned int sysctl_numa_balancing_scan_period_max; 50 + extern unsigned int sysctl_numa_balancing_scan_period_reset; 51 + extern unsigned int sysctl_numa_balancing_scan_size; 52 + extern unsigned int sysctl_numa_balancing_settle_count; 53 + 54 + #ifdef CONFIG_SCHED_DEBUG 55 + extern unsigned int sysctl_sched_migration_cost; 56 + extern unsigned int sysctl_sched_nr_migrate; 57 + extern unsigned int sysctl_sched_time_avg; 58 + extern unsigned int sysctl_timer_migration; 59 + extern unsigned int sysctl_sched_shares_window; 60 + 61 + int sched_proc_update_handler(struct ctl_table *table, int write, 62 + void __user *buffer, size_t *length, 63 + loff_t *ppos); 64 + #endif 65 + #ifdef CONFIG_SCHED_DEBUG 66 + static inline unsigned int get_sysctl_timer_migration(void) 67 + { 68 + return sysctl_timer_migration; 69 + } 70 + #else 71 + static inline unsigned int get_sysctl_timer_migration(void) 72 + { 73 + return 1; 74 + } 75 + #endif 76 + extern unsigned int sysctl_sched_rt_period; 77 + extern int sysctl_sched_rt_runtime; 78 + 79 + #ifdef CONFIG_CFS_BANDWIDTH 80 + extern unsigned int sysctl_sched_cfs_bandwidth_slice; 81 + #endif 82 + 83 + #ifdef CONFIG_SCHED_AUTOGROUP 84 + extern unsigned int sysctl_sched_autogroup_enabled; 85 + #endif 86 + 87 + /* 88 + * default timeslice is 100 msecs (used only for SCHED_RR tasks). 89 + * Timeslices get refilled after they expire. 90 + */ 91 + #define RR_TIMESLICE (100 * HZ / 1000) 92 + 93 + int sched_rt_handler(struct ctl_table *table, int write, 94 + void __user *buffer, size_t *lenp, 95 + loff_t *ppos); 96 + 97 + #endif /* _SCHED_SYSCTL_H */
+1
init/init_task.c
··· 2 2 #include <linux/export.h> 3 3 #include <linux/mqueue.h> 4 4 #include <linux/sched.h> 5 + #include <linux/sched/sysctl.h> 5 6 #include <linux/init.h> 6 7 #include <linux/fs.h> 7 8 #include <linux/mm.h>
+1
kernel/hrtimer.c
··· 44 44 #include <linux/err.h> 45 45 #include <linux/debugobjects.h> 46 46 #include <linux/sched.h> 47 + #include <linux/sched/sysctl.h> 47 48 #include <linux/timer.h> 48 49 49 50 #include <asm/uaccess.h>
+1
kernel/sched/sched.h
··· 1 1 2 2 #include <linux/sched.h> 3 + #include <linux/sched/sysctl.h> 3 4 #include <linux/mutex.h> 4 5 #include <linux/spinlock.h> 5 6 #include <linux/stop_machine.h>
+1
kernel/sysctl.c
··· 61 61 #include <linux/kmod.h> 62 62 #include <linux/capability.h> 63 63 #include <linux/binfmts.h> 64 + #include <linux/sched/sysctl.h> 64 65 65 66 #include <asm/uaccess.h> 66 67 #include <asm/processor.h>
+1
kernel/timer.c
··· 39 39 #include <linux/kallsyms.h> 40 40 #include <linux/irq_work.h> 41 41 #include <linux/sched.h> 42 + #include <linux/sched/sysctl.h> 42 43 #include <linux/slab.h> 43 44 44 45 #include <asm/uaccess.h>
+1
mm/mmap.c
··· 32 32 #include <linux/khugepaged.h> 33 33 #include <linux/uprobes.h> 34 34 #include <linux/rbtree_augmented.h> 35 + #include <linux/sched/sysctl.h> 35 36 36 37 #include <asm/uaccess.h> 37 38 #include <asm/cacheflush.h>
+1
mm/mremap.c
··· 19 19 #include <linux/security.h> 20 20 #include <linux/syscalls.h> 21 21 #include <linux/mmu_notifier.h> 22 + #include <linux/sched/sysctl.h> 22 23 23 24 #include <asm/uaccess.h> 24 25 #include <asm/cacheflush.h>
+1
mm/nommu.c
··· 29 29 #include <linux/security.h> 30 30 #include <linux/syscalls.h> 31 31 #include <linux/audit.h> 32 + #include <linux/sched/sysctl.h> 32 33 33 34 #include <asm/uaccess.h> 34 35 #include <asm/tlb.h>