Messages in this thread | | | Date | Mon, 15 Jul 2019 18:42:49 +0200 | From | Michal Koutný <> | Subject | Re: [PATCH v11 4/5] sched/core: uclamp: Use TG's clamps to restrict TASK's clamps |
| |
On Mon, Jul 08, 2019 at 09:43:56AM +0100, Patrick Bellasi <patrick.bellasi@arm.com> wrote: > This mimics what already happens for a task's CPU affinity mask when the > task is also in a cpuset, i.e. cgroup attributes are always used to > restrict per-task attributes. If I am not mistaken when set_schedaffinity(2) call is made that results in an empty cpuset, the call fails with EINVAL [1].
If I track the code correctly, the values passed to sched_setattr(2) are checked against the trivial validity (umin <= umax) and later on, they are adjusted to match the effective clamping of the containing task_group. Is that correct?
If the user attempted to sched_setattr [a, b], and the effective uclamp was [c, d] such that [a, b] ∩ [c, d] = ∅, the set uclamp will be silently moved out of their intended range. Wouldn't it be better to return with EINVAL too when the intersection is empty (since the user supplied range won't be attained)?
Michal
[1] http://www.linux-arm.org/git?p=linux-pb.git;a=blob;f=kernel/sched/core.c;h=ddc5fcd4b9cfaa95496b24d8599c03bc140e768e;hb=2c15043a2a2b5d86eb409556cbe1e36d4fd275b5#l1660
| |