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 extern unsigned int sysctl_sched_latency;
32 extern unsigned int sysctl_sched_min_granularity;
33 extern unsigned int sysctl_sched_wakeup_granularity;
34 
35 enum sched_tunable_scaling {
36 	SCHED_TUNABLESCALING_NONE,
37 	SCHED_TUNABLESCALING_LOG,
38 	SCHED_TUNABLESCALING_LINEAR,
39 	SCHED_TUNABLESCALING_END,
40 };
41 extern unsigned int sysctl_sched_tunable_scaling;
42 
43 extern unsigned int sysctl_numa_balancing_scan_delay;
44 extern unsigned int sysctl_numa_balancing_scan_period_min;
45 extern unsigned int sysctl_numa_balancing_scan_period_max;
46 extern unsigned int sysctl_numa_balancing_scan_size;
47 
48 #ifdef CONFIG_SCHED_DEBUG
49 extern __read_mostly unsigned int sysctl_sched_migration_cost;
50 extern __read_mostly unsigned int sysctl_sched_nr_migrate;
51 
52 extern int sysctl_resched_latency_warn_ms;
53 extern int sysctl_resched_latency_warn_once;
54 #endif
55 
56 /*
57  *  control realtime throttling:
58  *
59  *  /proc/sys/kernel/sched_rt_period_us
60  *  /proc/sys/kernel/sched_rt_runtime_us
61  */
62 extern unsigned int sysctl_sched_rt_period;
63 extern int sysctl_sched_rt_runtime;
64 
65 extern unsigned int sysctl_sched_dl_period_max;
66 extern unsigned int sysctl_sched_dl_period_min;
67 
68 #ifdef CONFIG_UCLAMP_TASK
69 extern unsigned int sysctl_sched_uclamp_util_min;
70 extern unsigned int sysctl_sched_uclamp_util_max;
71 extern unsigned int sysctl_sched_uclamp_util_min_rt_default;
72 #endif
73 
74 #ifdef CONFIG_CFS_BANDWIDTH
75 extern unsigned int sysctl_sched_cfs_bandwidth_slice;
76 #endif
77 
78 #ifdef CONFIG_SCHED_AUTOGROUP
79 extern unsigned int sysctl_sched_autogroup_enabled;
80 #endif
81 
82 extern int sysctl_sched_rr_timeslice;
83 extern int sched_rr_timeslice;
84 
85 int sched_rr_handler(struct ctl_table *table, int write, void *buffer,
86 		size_t *lenp, loff_t *ppos);
87 int sched_rt_handler(struct ctl_table *table, int write, void *buffer,
88 		size_t *lenp, loff_t *ppos);
89 int sysctl_sched_uclamp_handler(struct ctl_table *table, int write,
90 		void *buffer, size_t *lenp, loff_t *ppos);
91 int sysctl_numa_balancing(struct ctl_table *table, int write, void *buffer,
92 		size_t *lenp, loff_t *ppos);
93 int sysctl_schedstats(struct ctl_table *table, int write, void *buffer,
94 		size_t *lenp, loff_t *ppos);
95 
96 #if defined(CONFIG_ENERGY_MODEL) && defined(CONFIG_CPU_FREQ_GOV_SCHEDUTIL)
97 extern unsigned int sysctl_sched_energy_aware;
98 int sched_energy_aware_handler(struct ctl_table *table, int write,
99 		void *buffer, size_t *lenp, loff_t *ppos);
100 #endif
101 
102 #endif /* _LINUX_SCHED_SYSCTL_H */
103