blob: c9e4731cf10b8e97956b160c503e447490991931 [file] [log] [blame]
Clark Williamscf4aebc22013-02-07 09:46:59 -06001#ifndef _SCHED_SYSCTL_H
2#define _SCHED_SYSCTL_H
3
4#ifdef CONFIG_DETECT_HUNG_TASK
Li Zefancd646472013-09-23 16:43:58 +08005extern int sysctl_hung_task_check_count;
Clark Williamscf4aebc22013-02-07 09:46:59 -06006extern unsigned int sysctl_hung_task_panic;
Clark Williamscf4aebc22013-02-07 09:46:59 -06007extern unsigned long sysctl_hung_task_timeout_secs;
Aaron Tomlin270750db2014-01-20 17:34:13 +00008extern int sysctl_hung_task_warnings;
Clark Williamscf4aebc22013-02-07 09:46:59 -06009extern 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 */
14enum { 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.
Kirill A. Shutemov3fb1c8d2014-06-04 16:08:20 -070028 *
29 * ELF extended numbering allows more than 65535 sections, so 16-bit bound is
30 * not a hard limit any more. Although some userspace tools can be surprised by
31 * that.
Clark Williamscf4aebc22013-02-07 09:46:59 -060032 */
33#define MAPCOUNT_ELF_CORE_MARGIN (5)
34#define DEFAULT_MAX_MAP_COUNT (USHRT_MAX - MAPCOUNT_ELF_CORE_MARGIN)
35
36extern int sysctl_max_map_count;
37
38extern unsigned int sysctl_sched_latency;
39extern unsigned int sysctl_sched_min_granularity;
40extern unsigned int sysctl_sched_wakeup_granularity;
41extern unsigned int sysctl_sched_child_runs_first;
42
43enum sched_tunable_scaling {
44 SCHED_TUNABLESCALING_NONE,
45 SCHED_TUNABLESCALING_LOG,
46 SCHED_TUNABLESCALING_LINEAR,
47 SCHED_TUNABLESCALING_END,
48};
49extern enum sched_tunable_scaling sysctl_sched_tunable_scaling;
50
51extern unsigned int sysctl_numa_balancing_scan_delay;
52extern unsigned int sysctl_numa_balancing_scan_period_min;
53extern unsigned int sysctl_numa_balancing_scan_period_max;
Clark Williamscf4aebc22013-02-07 09:46:59 -060054extern unsigned int sysctl_numa_balancing_scan_size;
Clark Williamscf4aebc22013-02-07 09:46:59 -060055
56#ifdef CONFIG_SCHED_DEBUG
57extern unsigned int sysctl_sched_migration_cost;
58extern unsigned int sysctl_sched_nr_migrate;
59extern unsigned int sysctl_sched_time_avg;
Clark Williamscf4aebc22013-02-07 09:46:59 -060060extern unsigned int sysctl_sched_shares_window;
61
62int sched_proc_update_handler(struct ctl_table *table, int write,
63 void __user *buffer, size_t *length,
64 loff_t *ppos);
65#endif
Clark Williamsce0dbbb2013-02-07 09:47:04 -060066
67/*
68 * control realtime throttling:
69 *
70 * /proc/sys/kernel/sched_rt_period_us
71 * /proc/sys/kernel/sched_rt_runtime_us
72 */
Clark Williamscf4aebc22013-02-07 09:46:59 -060073extern unsigned int sysctl_sched_rt_period;
74extern int sysctl_sched_rt_runtime;
75
76#ifdef CONFIG_CFS_BANDWIDTH
77extern unsigned int sysctl_sched_cfs_bandwidth_slice;
78#endif
79
80#ifdef CONFIG_SCHED_AUTOGROUP
81extern unsigned int sysctl_sched_autogroup_enabled;
82#endif
83
Clark Williamsce0dbbb2013-02-07 09:47:04 -060084extern int sched_rr_timeslice;
85
86extern int sched_rr_handler(struct ctl_table *table, int write,
87 void __user *buffer, size_t *lenp,
88 loff_t *ppos);
89
90extern int sched_rt_handler(struct ctl_table *table, int write,
Clark Williamscf4aebc22013-02-07 09:46:59 -060091 void __user *buffer, size_t *lenp,
92 loff_t *ppos);
93
Andi Kleen54a43d52014-01-23 15:53:13 -080094extern int sysctl_numa_balancing(struct ctl_table *table, int write,
95 void __user *buffer, size_t *lenp,
96 loff_t *ppos);
97
Clark Williamscf4aebc22013-02-07 09:46:59 -060098#endif /* _SCHED_SYSCTL_H */