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