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 | extern unsigned int sysctl_sched_cfs_bandwidth_slice; | 41 | extern unsigned int sysctl_sched_cfs_bandwidth_slice; |
| 42 | #endif | 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 | int sysctl_sched_uclamp_handler(struct ctl_table *table, int write, | 44 | int sysctl_sched_uclamp_handler(struct ctl_table *table, int write, |
| 50 | void *buffer, size_t *lenp, loff_t *ppos); | 45 | void *buffer, size_t *lenp, loff_t *ppos); |
| 51 | int sysctl_numa_balancing(struct ctl_table *table, int write, void *buffer, | 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 | int sched_rr_timeslice = RR_TIMESLICE; | 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 | /* More than 4 hours if BW_SHIFT equals 20. */ | 9 | /* More than 4 hours if BW_SHIFT equals 20. */ |
| 10 | static const u64 max_rt_runtime = MAX_BW; | 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 | static int sched_rt_handler(struct ctl_table *table, int write, void *buffer, | 28 | static int sched_rt_handler(struct ctl_table *table, int write, void *buffer, |
| 29 | size_t *lenp, loff_t *ppos); | 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 | #ifdef CONFIG_SYSCTL | 32 | #ifdef CONFIG_SYSCTL |
| 31 | static struct ctl_table sched_rt_sysctls[] = { | 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 | .mode = 0644, | 45 | .mode = 0644, |
| 44 | .proc_handler = sched_rt_handler, | 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 | return ret; | 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 | size_t *lenp, loff_t *ppos) | 3018 | size_t *lenp, loff_t *ppos) |
| 3010 | { | 3019 | { |
| 3011 | int ret; | 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 | extern unsigned int sysctl_sched_rt_period; | 118 | extern unsigned int sysctl_sched_rt_period; |
| 119 | extern int sysctl_sched_rt_runtime; | 119 | extern int sysctl_sched_rt_runtime; |
| 120 | extern int sched_rr_timeslice; | ||
| 120 | 121 | ||
| 121 | /* | 122 | /* |
| 122 | * Helpers for converting nanosecond timing to jiffy resolution | 123 | * Helpers for converting nanosecond timing to jiffy resolution |
| @@ -1681,13 +1681,6 @@ static struct ctl_table kern_table[] = { · 1680 unmodified lines | |||
| 1681 | .extra2 = SYSCTL_FOUR, | 1681 | .extra2 = SYSCTL_FOUR, |
| 1682 | }, | 1682 | }, |
| 1683 | #endif /* CONFIG_NUMA_BALANCING */ | 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 | #ifdef CONFIG_UCLAMP_TASK | 1684 | #ifdef CONFIG_UCLAMP_TASK |
| 1692 | { | 1685 | { |
| 1693 | .procname = "sched_util_clamp_min", | 1686 | .procname = "sched_util_clamp_min", |