Skip to content

Commit

Permalink
Revert "uclamp_assist: Do not allow userspace to overwrite default va…
Browse files Browse the repository at this point in the history
…lues"

This reverts commit 28096f7d953ab4b774e0900f5c3ea2ca27b551e7.
  • Loading branch information
ztc1997 authored and toraidl committed Mar 8, 2024
1 parent 1b46e94 commit 897b996
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions kernel/sched/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -8018,7 +8018,7 @@ cpu_cgroup_css_alloc(struct cgroup_subsys_state *parent_css)
}

#ifdef CONFIG_UCLAMP_ASSIST
static bool uclamp_set(struct cgroup_subsys_state *css);
static void uclamp_set(struct cgroup_subsys_state *css);
#endif

/* Expose task group only after completing cgroup initialization */
Expand Down Expand Up @@ -8252,11 +8252,6 @@ static ssize_t cpu_uclamp_write(struct kernfs_open_file *of, char *buf,
struct uclamp_request req;
struct task_group *tg;

#ifdef CONFIG_UCLAMP_ASSIST
if (uclamp_set(of_css(of)))
return nbytes;
#endif

req = capacity_from_percent(buf);
if (req.ret)
return req.ret;
Expand Down Expand Up @@ -8363,7 +8358,7 @@ struct uclamp_param {
u64 uclamp_latency_sensitive;
};

static bool uclamp_set(struct cgroup_subsys_state *css)
static void uclamp_set(struct cgroup_subsys_state *css)
{
int i;

Expand All @@ -8377,7 +8372,7 @@ static bool uclamp_set(struct cgroup_subsys_state *css)
};

if (!css->cgroup->kn)
return false;
return;

for (i = 0; i < ARRAY_SIZE(tgts); i++) {
struct uclamp_param tgt = tgts[i];
Expand All @@ -8392,11 +8387,9 @@ static bool uclamp_set(struct cgroup_subsys_state *css)

pr_info("uclamp_assist: setting values for %s: uclamp_min=%s uclamp_max=%s uclamp_latency_sensitive=%d\n",
tgt.name, tgt.uclamp_min, tgt.uclamp_max,tgt.uclamp_latency_sensitive);
return true;
return;
}
}

return false;
}
#endif /* CONFIG_UCLAMP_ASSIST */

Expand Down

0 comments on commit 897b996

Please sign in to comment.