Skip to content

Commit

Permalink
sched/uclamp: Move all tunables back to cpuctl
Browse files Browse the repository at this point in the history
Signed-off-by: YumeMichi <[email protected]>
Change-Id: Id3d2cc737c8f9870522c2316a964594d6771aa67
  • Loading branch information
YumeMichi committed Oct 8, 2021
1 parent 26389f0 commit 5636d16
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 92 deletions.
48 changes: 0 additions & 48 deletions kernel/cpuset.c
Original file line number Diff line number Diff line change
Expand Up @@ -1851,28 +1851,6 @@ static s64 cpuset_read_s64(struct cgroup_subsys_state *css, struct cftype *cft)
return 0;
}

#ifdef CONFIG_UCLAMP_TASK_GROUP
int cpu_uclamp_min_show_wrapper(struct seq_file *sf, void *v);
int cpu_uclamp_max_show_wrapper(struct seq_file *sf, void *v);

ssize_t cpu_uclamp_min_write_wrapper(struct kernfs_open_file *of,
char *buf, size_t nbytes,
loff_t off);
ssize_t cpu_uclamp_max_write_wrapper(struct kernfs_open_file *of,
char *buf, size_t nbytes,
loff_t off);

int cpu_uclamp_ls_write_u64_wrapper(struct cgroup_subsys_state *css,
struct cftype *cftype, u64 ls);
u64 cpu_uclamp_ls_read_u64_wrapper(struct cgroup_subsys_state *css,
struct cftype *cft);

int cpu_uclamp_boost_write_u64_wrapper(struct cgroup_subsys_state *css,
struct cftype *cftype, u64 boost);
u64 cpu_uclamp_boost_read_u64_wrapper(struct cgroup_subsys_state *css,
struct cftype *cft);
#endif

/*
* for the common functions, 'private' gives the type of file
*/
Expand Down Expand Up @@ -1975,32 +1953,6 @@ static struct cftype files[] = {
.write_u64 = cpuset_write_u64,
.private = FILE_MEMORY_PRESSURE_ENABLED,
},
#ifdef CONFIG_UCLAMP_TASK_GROUP
{
.name = "uclamp.min",
.flags = CFTYPE_NOT_ON_ROOT,
.seq_show = cpu_uclamp_min_show_wrapper,
.write = cpu_uclamp_min_write_wrapper,
},
{
.name = "uclamp.max",
.flags = CFTYPE_NOT_ON_ROOT,
.seq_show = cpu_uclamp_max_show_wrapper,
.write = cpu_uclamp_max_write_wrapper,
},
{
.name = "uclamp.latency_sensitive",
.flags = CFTYPE_NOT_ON_ROOT,
.read_u64 = cpu_uclamp_ls_read_u64_wrapper,
.write_u64 = cpu_uclamp_ls_write_u64_wrapper,
},
{
.name = "uclamp.boosted",
.flags = CFTYPE_NOT_ON_ROOT,
.read_u64 = cpu_uclamp_boost_read_u64_wrapper,
.write_u64 = cpu_uclamp_boost_write_u64_wrapper,
},
#endif
{ } /* terminate */
};

Expand Down
70 changes: 26 additions & 44 deletions kernel/sched/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -10262,50 +10262,6 @@ static u64 cpu_uclamp_boost_read_u64(struct cgroup_subsys_state *css,
return (u64) tg->boosted;
}

/* Wrappers for the above {read, write, show} functions */
int cpu_uclamp_min_show_wrapper(struct seq_file *sf, void *v)
{
return cpu_uclamp_min_show(sf, v);
}
int cpu_uclamp_max_show_wrapper(struct seq_file *sf, void *v)
{
return cpu_uclamp_max_show(sf, v);
}

ssize_t cpu_uclamp_min_write_wrapper(struct kernfs_open_file *of,
char *buf, size_t nbytes,
loff_t off)
{
return cpu_uclamp_min_write(of, buf, nbytes, off);
}
ssize_t cpu_uclamp_max_write_wrapper(struct kernfs_open_file *of,
char *buf, size_t nbytes,
loff_t off)
{
return cpu_uclamp_max_write(of, buf, nbytes, off);
}

int cpu_uclamp_ls_write_u64_wrapper(struct cgroup_subsys_state *css,
struct cftype *cftype, u64 ls)
{
return cpu_uclamp_ls_write_u64(css, cftype, ls);
}
u64 cpu_uclamp_ls_read_u64_wrapper(struct cgroup_subsys_state *css,
struct cftype *cft)
{
return cpu_uclamp_ls_read_u64(css, cft);
}

int cpu_uclamp_boost_write_u64_wrapper(struct cgroup_subsys_state *css,
struct cftype *cftype, u64 boost)
{
return cpu_uclamp_boost_write_u64(css, cftype, boost);
}
u64 cpu_uclamp_boost_read_u64_wrapper(struct cgroup_subsys_state *css,
struct cftype *cft)
{
return cpu_uclamp_boost_read_u64(css, cft);
}
#endif /* CONFIG_UCLAMP_TASK_GROUP */

#ifdef CONFIG_FAIR_GROUP_SCHED
Expand Down Expand Up @@ -10634,6 +10590,32 @@ static struct cftype cpu_files[] = {
.read_u64 = cpu_rt_period_read_uint,
.write_u64 = cpu_rt_period_write_uint,
},
#endif
#ifdef CONFIG_UCLAMP_TASK_GROUP
{
.name = "uclamp.min",
.flags = CFTYPE_NOT_ON_ROOT,
.seq_show = cpu_uclamp_min_show,
.write = cpu_uclamp_min_write,
},
{
.name = "uclamp.max",
.flags = CFTYPE_NOT_ON_ROOT,
.seq_show = cpu_uclamp_max_show,
.write = cpu_uclamp_max_write,
},
{
.name = "uclamp.latency_sensitive",
.flags = CFTYPE_NOT_ON_ROOT,
.read_u64 = cpu_uclamp_ls_read_u64,
.write_u64 = cpu_uclamp_ls_write_u64,
},
{
.name = "uclamp.boosted",
.flags = CFTYPE_NOT_ON_ROOT,
.read_u64 = cpu_uclamp_boost_read_u64,
.write_u64 = cpu_uclamp_boost_write_u64,
},
#endif
{ } /* terminate */
};
Expand Down

0 comments on commit 5636d16

Please sign in to comment.