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
41extern unsigned int sysctl_sched_cfs_bandwidth_slice;41extern unsigned int sysctl_sched_cfs_bandwidth_slice;
42#endif42#endif
43 43
44extern int sysctl_sched_rr_timeslice;
45extern int sched_rr_timeslice;
46
47int sched_rr_handler(struct ctl_table *table, int write, void *buffer,
48 size_t *lenp, loff_t *ppos);
49int sysctl_sched_uclamp_handler(struct ctl_table *table, int write,44int 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);
51int sysctl_numa_balancing(struct ctl_table *table, int write, void *buffer,46int sysctl_numa_balancing(struct ctl_table *table, int write, void *buffer,
kernel/sched/rt.c+11−2
@@ -5,7 +5,7 @@ · 4 unmodified lines
5 */5 */
6 6
7int sched_rr_timeslice = RR_TIMESLICE;7int sched_rr_timeslice = RR_TIMESLICE;
8int sysctl_sched_rr_timeslice = (MSEC_PER_SEC / HZ) * RR_TIMESLICE;8static 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. */
10static const u64 max_rt_runtime = MAX_BW;10static const u64 max_rt_runtime = MAX_BW;
11 11
@@ -27,6 +27,8 @@ int sysctl_sched_rt_runtime = 950000; · 15 unmodified lines
27 27
28static int sched_rt_handler(struct ctl_table *table, int write, void *buffer,28static 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);
30static int sched_rr_handler(struct ctl_table *table, int write, void *buffer,
31 size_t *lenp, loff_t *ppos);
30#ifdef CONFIG_SYSCTL32#ifdef CONFIG_SYSCTL
31static struct ctl_table sched_rt_sysctls[] = {33static 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
3008int sched_rr_handler(struct ctl_table *table, int write, void *buffer,3017static 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;
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
117 117
118extern unsigned int sysctl_sched_rt_period;118extern unsigned int sysctl_sched_rt_period;
119extern int sysctl_sched_rt_runtime;119extern int sysctl_sched_rt_runtime;
120extern int sched_rr_timeslice;
120 121
121/*122/*
122 * Helpers for converting nanosecond timing to jiffy resolution123 * 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
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_TASK1684#ifdef CONFIG_UCLAMP_TASK
1692 {1685 {
1693 .procname = "sched_util_clamp_min",1686 .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