• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 #ifdef CONFIG_SCHED_WALT
34 extern unsigned int sysctl_sched_use_walt_cpu_util;
35 extern unsigned int sysctl_sched_use_walt_task_util;
36 extern unsigned int sysctl_sched_walt_init_task_load_pct;
37 extern unsigned int sysctl_sched_cpu_high_irqload;
38 
39 extern int
40 sysctl_sched_walt_init_task_load_pct_sysctl_handler(struct ctl_table *table,
41 		int write, void __user *buffer, size_t *length, loff_t *ppos);
42 #endif
43 
44 #ifdef CONFIG_SCHED_RT_CAS
45 extern unsigned int sysctl_sched_enable_rt_cas;
46 #endif
47 #ifdef CONFIG_SCHED_RT_ACTIVE_LB
48 extern unsigned int sysctl_sched_enable_rt_active_lb;
49 #endif
50 
51 enum sched_tunable_scaling {
52 	SCHED_TUNABLESCALING_NONE,
53 	SCHED_TUNABLESCALING_LOG,
54 	SCHED_TUNABLESCALING_LINEAR,
55 	SCHED_TUNABLESCALING_END,
56 };
57 extern enum sched_tunable_scaling sysctl_sched_tunable_scaling;
58 
59 extern unsigned int sysctl_numa_balancing_scan_delay;
60 extern unsigned int sysctl_numa_balancing_scan_period_min;
61 extern unsigned int sysctl_numa_balancing_scan_period_max;
62 extern unsigned int sysctl_numa_balancing_scan_size;
63 
64 #ifdef CONFIG_SCHED_DEBUG
65 extern __read_mostly unsigned int sysctl_sched_migration_cost;
66 extern __read_mostly unsigned int sysctl_sched_nr_migrate;
67 
68 int sched_proc_update_handler(struct ctl_table *table, int write,
69 		void *buffer, size_t *length, loff_t *ppos);
70 #endif
71 
72 /*
73  *  control realtime throttling:
74  *
75  *  /proc/sys/kernel/sched_rt_period_us
76  *  /proc/sys/kernel/sched_rt_runtime_us
77  */
78 extern unsigned int sysctl_sched_rt_period;
79 extern int sysctl_sched_rt_runtime;
80 
81 extern unsigned int sysctl_sched_dl_period_max;
82 extern unsigned int sysctl_sched_dl_period_min;
83 
84 #ifdef CONFIG_UCLAMP_TASK
85 extern unsigned int sysctl_sched_uclamp_util_min;
86 extern unsigned int sysctl_sched_uclamp_util_max;
87 extern unsigned int sysctl_sched_uclamp_util_min_rt_default;
88 #endif
89 
90 #ifdef CONFIG_CFS_BANDWIDTH
91 extern unsigned int sysctl_sched_cfs_bandwidth_slice;
92 #endif
93 
94 #ifdef CONFIG_SCHED_AUTOGROUP
95 extern unsigned int sysctl_sched_autogroup_enabled;
96 #endif
97 
98 extern int sysctl_sched_rr_timeslice;
99 extern int sched_rr_timeslice;
100 
101 int sched_rr_handler(struct ctl_table *table, int write, void *buffer,
102 		size_t *lenp, loff_t *ppos);
103 int sched_rt_handler(struct ctl_table *table, int write, void *buffer,
104 		size_t *lenp, loff_t *ppos);
105 int sysctl_sched_uclamp_handler(struct ctl_table *table, int write,
106 		void *buffer, size_t *lenp, loff_t *ppos);
107 int sysctl_numa_balancing(struct ctl_table *table, int write, void *buffer,
108 		size_t *lenp, loff_t *ppos);
109 int sysctl_schedstats(struct ctl_table *table, int write, void *buffer,
110 		size_t *lenp, loff_t *ppos);
111 
112 #if defined(CONFIG_ENERGY_MODEL) && defined(CONFIG_CPU_FREQ_GOV_SCHEDUTIL)
113 extern unsigned int sysctl_sched_energy_aware;
114 int sched_energy_aware_handler(struct ctl_table *table, int write,
115 		void *buffer, size_t *lenp, loff_t *ppos);
116 #endif
117 
118 #endif /* _LINUX_SCHED_SYSCTL_H */
119