move rr_timeslice sysctls to rt.c and use the new register_sysctl_init() to register the sysctl interface.
Unified · Split
| @@ -41,11 +41,6 @@ extern unsigned int sysctl_sched_uclamp_util_min_rt_default; · 40 unmodified lines | ||
| 41 | 41 | extern unsigned int sysctl_sched_cfs_bandwidth_slice; |
| 42 | 42 | #endif |
| 43 | 43 | |
| 44 | −extern int sysctl_sched_rr_timeslice; | |
| 45 | −extern int sched_rr_timeslice; | |
| 46 | − | |
| 47 | −int sched_rr_handler(struct ctl_table *table, int write, void *buffer, | |
| 48 | − size_t *lenp, loff_t *ppos); | |
| 49 | 44 | int sysctl_sched_uclamp_handler(struct ctl_table *table, int write, |
| 50 | 45 | void *buffer, size_t *lenp, loff_t *ppos); |
| 51 | 46 | int sysctl_numa_balancing(struct ctl_table *table, int write, void *buffer, |
| @@ -5,7 +5,7 @@ · 4 unmodified lines | ||
| 5 | 5 | */ |
| 6 | 6 | |
| 7 | 7 | int sched_rr_timeslice = RR_TIMESLICE; |
| 8 | −int sysctl_sched_rr_timeslice = (MSEC_PER_SEC / HZ) * RR_TIMESLICE; | |
| 8 | +static int sysctl_sched_rr_timeslice = (MSEC_PER_SEC / HZ) * RR_TIMESLICE; | |
| 9 | 9 | /* More than 4 hours if BW_SHIFT equals 20. */ |
| 10 | 10 | static const u64 max_rt_runtime = MAX_BW; |
| 11 | 11 | |
| @@ -27,6 +27,8 @@ int sysctl_sched_rt_runtime = 950000; · 15 unmodified lines | ||
| 27 | 27 | |
| 28 | 28 | static int sched_rt_handler(struct ctl_table *table, int write, void *buffer, |
| 29 | 29 | size_t *lenp, loff_t *ppos); |
| 30 | +static int sched_rr_handler(struct ctl_table *table, int write, void *buffer, | |
| 31 | + size_t *lenp, loff_t *ppos); | |
| 30 | 32 | #ifdef CONFIG_SYSCTL |
| 31 | 33 | static struct ctl_table sched_rt_sysctls[] = { |
| 32 | 34 | { |
| @@ -43,6 +45,13 @@ static struct ctl_table sched_rt_sysctls[] = { · 10 unmodified lines | ||
| 43 | 45 | .mode = 0644, |
| 44 | 46 | .proc_handler = sched_rt_handler, |
| 45 | 47 | }, |
| 48 | + { | |
| 49 | + .procname = "sched_rr_timeslice_ms", | |
| 50 | + .data = &sysctl_sched_rr_timeslice, | |
| 51 | + .maxlen = sizeof(int), | |
| 52 | + .mode = 0644, | |
| 53 | + .proc_handler = sched_rr_handler, | |
| 54 | + }, | |
| 46 | 55 | {} |
| 47 | 56 | }; |
| 48 | 57 | |
| @@ -3005,7 +3014,7 @@ undo: · 2956 unmodified lines | ||
| 3005 | 3014 | return ret; |
| 3006 | 3015 | } |
| 3007 | 3016 | |
| 3008 | −int sched_rr_handler(struct ctl_table *table, int write, void *buffer, | |
| 3017 | +static int sched_rr_handler(struct ctl_table *table, int write, void *buffer, | |
| 3009 | 3018 | size_t *lenp, loff_t *ppos) |
| 3010 | 3019 | { |
| 3011 | 3020 | int ret; |
| @@ -117,6 +117,7 @@ extern void call_trace_sched_update_nr_running(struct rq *rq, int count); · 116 unmodified lines | ||
| 117 | 117 | |
| 118 | 118 | extern unsigned int sysctl_sched_rt_period; |
| 119 | 119 | extern int sysctl_sched_rt_runtime; |
| 120 | +extern int sched_rr_timeslice; | |
| 120 | 121 | |
| 121 | 122 | /* |
| 122 | 123 | * Helpers for converting nanosecond timing to jiffy resolution |
| @@ -1681,13 +1681,6 @@ static struct ctl_table kern_table[] = { · 1680 unmodified lines | ||
| 1681 | 1681 | .extra2 = SYSCTL_FOUR, |
| 1682 | 1682 | }, |
| 1683 | 1683 | #endif /* CONFIG_NUMA_BALANCING */ |
| 1684 | − { | |
| 1685 | − .procname = "sched_rr_timeslice_ms", | |
| 1686 | − .data = &sysctl_sched_rr_timeslice, | |
| 1687 | − .maxlen = sizeof(int), | |
| 1688 | − .mode = 0644, | |
| 1689 | − .proc_handler = sched_rr_handler, | |
| 1690 | − }, | |
| 1691 | 1684 | #ifdef CONFIG_UCLAMP_TASK |
| 1692 | 1685 | { |
| 1693 | 1686 | .procname = "sched_util_clamp_min", |