1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _LINUX_SCHED_SYSCTL_H
3 #define _LINUX_SCHED_SYSCTL_H
4 
5 #include <linux/types.h>
6 
7 struct ctl_table;
8 
9 #ifdef CONFIG_DETECT_HUNG_TASK
10 
11 #ifdef CONFIG_SMP
12 extern unsigned int sysctl_hung_task_all_cpu_backtrace;
13 #else
14 #define sysctl_hung_task_all_cpu_backtrace 0
15 #endif /* CONFIG_SMP */
16 
17 extern int	     sysctl_hung_task_check_count;
18 extern unsigned int  sysctl_hung_task_panic;
19 extern unsigned long sysctl_hung_task_timeout_secs;
20 extern unsigned long sysctl_hung_task_check_interval_secs;
21 extern int sysctl_hung_task_warnings;
22 int proc_dohung_task_timeout_secs(struct ctl_table *table, int write,
23 		void *buffer, size_t *lenp, loff_t *ppos);
24 #else
25 /* Avoid need for ifdefs elsewhere in the code */
26 enum { sysctl_hung_task_timeout_secs = 0 };
27 #endif
28 
29 extern unsigned int sysctl_sched_latency;
30 extern unsigned int sysctl_sched_min_granularity;
31 extern unsigned int sysctl_sched_wakeup_granularity;
32 extern unsigned int sysctl_sched_child_runs_first;
33 
34 enum sched_tunable_scaling {
35 	SCHED_TUNABLESCALING_NONE,
36 	SCHED_TUNABLESCALING_LOG,
37 	SCHED_TUNABLESCALING_LINEAR,
38 	SCHED_TUNABLESCALING_END,
39 };
40 extern enum sched_tunable_scaling sysctl_sched_tunable_scaling;
41 
42 extern unsigned int sysctl_numa_balancing_scan_delay;
43 extern unsigned int sysctl_numa_balancing_scan_period_min;
44 extern unsigned int sysctl_numa_balancing_scan_period_max;
45 extern unsigned int sysctl_numa_balancing_scan_size;
46 
47 #ifdef CONFIG_SCHED_DEBUG
48 extern __read_mostly unsigned int sysctl_sched_migration_cost;
49 extern __read_mostly unsigned int sysctl_sched_nr_migrate;
50 
51 int sched_proc_update_handler(struct ctl_table *table, int write,
52 		void *buffer, size_t *length, loff_t *ppos);
53 #endif
54 
55 /*
56  *  control realtime throttling:
57  *
58  *  /proc/sys/kernel/sched_rt_period_us
59  *  /proc/sys/kernel/sched_rt_runtime_us
60  */
61 extern unsigned int sysctl_sched_rt_period;
62 extern int sysctl_sched_rt_runtime;
63 
64 extern unsigned int sysctl_sched_dl_period_max;
65 extern unsigned int sysctl_sched_dl_period_min;
66 
67 #ifdef CONFIG_UCLAMP_TASK
68 extern unsigned int sysctl_sched_uclamp_util_min;
69 extern unsigned int sysctl_sched_uclamp_util_max;
70 extern unsigned int sysctl_sched_uclamp_util_min_rt_default;
71 #endif
72 
73 #ifdef CONFIG_CFS_BANDWIDTH
74 extern unsigned int sysctl_sched_cfs_bandwidth_slice;
75 #endif
76 
77 #ifdef CONFIG_SCHED_AUTOGROUP
78 extern unsigned int sysctl_sched_autogroup_enabled;
79 #endif
80 
81 extern int sysctl_sched_rr_timeslice;
82 extern int sched_rr_timeslice;
83 
84 int sched_rr_handler(struct ctl_table *table, int write, void *buffer,
85 		size_t *lenp, loff_t *ppos);
86 int sched_rt_handler(struct ctl_table *table, int write, void *buffer,
87 		size_t *lenp, loff_t *ppos);
88 int sysctl_sched_uclamp_handler(struct ctl_table *table, int write,
89 		void *buffer, size_t *lenp, loff_t *ppos);
90 int sysctl_numa_balancing(struct ctl_table *table, int write, void *buffer,
91 		size_t *lenp, loff_t *ppos);
92 int sysctl_schedstats(struct ctl_table *table, int write, void *buffer,
93 		size_t *lenp, loff_t *ppos);
94 
95 #if defined(CONFIG_ENERGY_MODEL) && defined(CONFIG_CPU_FREQ_GOV_SCHEDUTIL)
96 extern unsigned int sysctl_sched_energy_aware;
97 int sched_energy_aware_handler(struct ctl_table *table, int write,
98 		void *buffer, size_t *lenp, loff_t *ppos);
99 #endif
100 
101 #endif /* _LINUX_SCHED_SYSCTL_H */
102