History

sched: Move rr_timeslice sysctls to rt.c

move rr_timeslice sysctls to rt.c and use the new register_sysctl_init() to register the sysctl interface.

Zhen Ni committed 4 years ago

Commit dafd7a91 parent 84227c14 files · +12 −14Browse files

Unified · Split

4 files
  1. include/linux/sched/sysctl.h +0 −5
  2. kernel/sched/rt.c +11 −2
  3. kernel/sched/sched.h +1 −0
  4. kernel/sysctl.c +0 −7
include/linux/sched/sysctl.h+0−5
@@ -41,11 +41,6 @@ extern unsigned int sysctl_sched_uclamp_util_min_rt_default; · 40 unmodified lines
4141 extern unsigned int sysctl_sched_cfs_bandwidth_slice;
4242 #endif
4343
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);
4944 int sysctl_sched_uclamp_handler(struct ctl_table *table, int write,
5045 void *buffer, size_t *lenp, loff_t *ppos);
5146 int sysctl_numa_balancing(struct ctl_table *table, int write, void *buffer,
kernel/sched/rt.c+11−2
@@ -5,7 +5,7 @@ · 4 unmodified lines
55 */
66
77 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;
99 /* More than 4 hours if BW_SHIFT equals 20. */
1010 static const u64 max_rt_runtime = MAX_BW;
1111
@@ -27,6 +27,8 @@ int sysctl_sched_rt_runtime = 950000; · 15 unmodified lines
2727
2828 static int sched_rt_handler(struct ctl_table *table, int write, void *buffer,
2929 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);
3032 #ifdef CONFIG_SYSCTL
3133 static struct ctl_table sched_rt_sysctls[] = {
3234 {
@@ -43,6 +45,13 @@ static struct ctl_table sched_rt_sysctls[] = { · 10 unmodified lines
4345 .mode = 0644,
4446 .proc_handler = sched_rt_handler,
4547 },
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+ },
4655 {}
4756 };
4857
@@ -3005,7 +3014,7 @@ undo: · 2956 unmodified lines
30053014 return ret;
30063015 }
30073016
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,
30093018 size_t *lenp, loff_t *ppos)
30103019 {
30113020 int ret;
kernel/sched/sched.h+1−0
@@ -117,6 +117,7 @@ extern void call_trace_sched_update_nr_running(struct rq *rq, int count); · 116 unmodified lines
117117
118118 extern unsigned int sysctl_sched_rt_period;
119119 extern int sysctl_sched_rt_runtime;
120+extern int sched_rr_timeslice;
120121
121122 /*
122123 * Helpers for converting nanosecond timing to jiffy resolution
kernel/sysctl.c+0−7
@@ -1681,13 +1681,6 @@ static struct ctl_table kern_table[] = { · 1680 unmodified lines
16811681 .extra2 = SYSCTL_FOUR,
16821682 },
16831683 #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− },
16911684 #ifdef CONFIG_UCLAMP_TASK
16921685 {
16931686 .procname = "sched_util_clamp_min",

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t