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
7struct ctl_table;
8
9#ifdef CONFIG_DETECT_HUNG_TASK
10extern int sysctl_hung_task_check_count;
11extern unsigned int sysctl_hung_task_panic;
12extern unsigned long sysctl_hung_task_timeout_secs;
13extern unsigned long sysctl_hung_task_check_interval_secs;
14extern int sysctl_hung_task_warnings;
15extern 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 */
20enum { sysctl_hung_task_timeout_secs = 0 };
21#endif
22
23extern unsigned int sysctl_sched_latency;
24extern unsigned int sysctl_sched_min_granularity;
25extern unsigned int sysctl_sched_wakeup_granularity;
26extern unsigned int sysctl_sched_child_runs_first;
27
28enum sched_tunable_scaling {
29 SCHED_TUNABLESCALING_NONE,
30 SCHED_TUNABLESCALING_LOG,
31 SCHED_TUNABLESCALING_LINEAR,
32 SCHED_TUNABLESCALING_END,
33};
34extern enum sched_tunable_scaling sysctl_sched_tunable_scaling;
35
36extern unsigned int sysctl_numa_balancing_scan_delay;
37extern unsigned int sysctl_numa_balancing_scan_period_min;
38extern unsigned int sysctl_numa_balancing_scan_period_max;
39extern unsigned int sysctl_numa_balancing_scan_size;
40
41#ifdef CONFIG_SCHED_DEBUG
42extern __read_mostly unsigned int sysctl_sched_migration_cost;
43extern __read_mostly unsigned int sysctl_sched_nr_migrate;
44
45int 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 */
56extern unsigned int sysctl_sched_rt_period;
57extern int sysctl_sched_rt_runtime;
58
59#ifdef CONFIG_CFS_BANDWIDTH
60extern unsigned int sysctl_sched_cfs_bandwidth_slice;
61#endif
62
63#ifdef CONFIG_SCHED_AUTOGROUP
64extern unsigned int sysctl_sched_autogroup_enabled;
65#endif
66
67extern int sysctl_sched_rr_timeslice;
68extern int sched_rr_timeslice;
69
70extern int sched_rr_handler(struct ctl_table *table, int write,
71 void __user *buffer, size_t *lenp,
72 loff_t *ppos);
73
74extern int sched_rt_handler(struct ctl_table *table, int write,
75 void __user *buffer, size_t *lenp,
76 loff_t *ppos);
77
78extern int sysctl_numa_balancing(struct ctl_table *table, int write,
79 void __user *buffer, size_t *lenp,
80 loff_t *ppos);
81
82extern int sysctl_schedstats(struct ctl_table *table, int write,
83 void __user *buffer, size_t *lenp,
84 loff_t *ppos);
85
86#if defined(CONFIG_ENERGY_MODEL) && defined(CONFIG_CPU_FREQ_GOV_SCHEDUTIL)
87extern unsigned int sysctl_sched_energy_aware;
88extern int sched_energy_aware_handler(struct ctl_table *table, int write,
89 void __user *buffer, size_t *lenp,
90 loff_t *ppos);
91#endif
92
93#endif /* _LINUX_SCHED_SYSCTL_H */
94