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_child_runs_first;
30 
31 enum sched_tunable_scaling {
32 	SCHED_TUNABLESCALING_NONE,
33 	SCHED_TUNABLESCALING_LOG,
34 	SCHED_TUNABLESCALING_LINEAR,
35 	SCHED_TUNABLESCALING_END,
36 };
37 
38 /*
39  *  control realtime throttling:
40  *
41  *  /proc/sys/kernel/sched_rt_period_us
42  *  /proc/sys/kernel/sched_rt_runtime_us
43  */
44 extern unsigned int sysctl_sched_rt_period;
45 extern int sysctl_sched_rt_runtime;
46 
47 extern unsigned int sysctl_sched_dl_period_max;
48 extern unsigned int sysctl_sched_dl_period_min;
49 
50 #ifdef CONFIG_UCLAMP_TASK
51 extern unsigned int sysctl_sched_uclamp_util_min;
52 extern unsigned int sysctl_sched_uclamp_util_max;
53 extern unsigned int sysctl_sched_uclamp_util_min_rt_default;
54 #endif
55 
56 #ifdef CONFIG_CFS_BANDWIDTH
57 extern unsigned int sysctl_sched_cfs_bandwidth_slice;
58 #endif
59 
60 #ifdef CONFIG_SCHED_AUTOGROUP
61 extern unsigned int sysctl_sched_autogroup_enabled;
62 #endif
63 
64 extern int sysctl_sched_rr_timeslice;
65 extern int sched_rr_timeslice;
66 
67 int sched_rr_handler(struct ctl_table *table, int write, void *buffer,
68 		size_t *lenp, loff_t *ppos);
69 int sched_rt_handler(struct ctl_table *table, int write, void *buffer,
70 		size_t *lenp, loff_t *ppos);
71 int sysctl_sched_uclamp_handler(struct ctl_table *table, int write,
72 		void *buffer, size_t *lenp, loff_t *ppos);
73 int sysctl_numa_balancing(struct ctl_table *table, int write, void *buffer,
74 		size_t *lenp, loff_t *ppos);
75 int sysctl_schedstats(struct ctl_table *table, int write, void *buffer,
76 		size_t *lenp, loff_t *ppos);
77 
78 #if defined(CONFIG_ENERGY_MODEL) && defined(CONFIG_CPU_FREQ_GOV_SCHEDUTIL)
79 extern unsigned int sysctl_sched_energy_aware;
80 int sched_energy_aware_handler(struct ctl_table *table, int write,
81 		void *buffer, size_t *lenp, loff_t *ppos);
82 #endif
83 
84 #endif /* _LINUX_SCHED_SYSCTL_H */
85