Hi Quentin On 04/15/20 11:11, Quentin Perret wrote: > Hi Qais, > > On Friday 03 Apr 2020 at 13:30:19 (+0100), Qais Yousef wrote: > <snip> > > + /* > > + * The new value will be applied to all RT tasks the next time they > > + * wakeup, assuming the task is using the system default and not a user > > + * specified value. In the latter we shall leave the value as the user > > + * requested. > > + */ > > if (sysctl_sched_uclamp_util_min > sysctl_sched_uclamp_util_max || > > sysctl_sched_uclamp_util_max > SCHED_CAPACITY_SCALE) { > > result = -EINVAL; > > goto undo; > > } > > > > + if (sysctl_sched_rt_default_uclamp_util_min > SCHED_CAPACITY_SCALE) { > > + result = -EINVAL; > > + goto undo; > > + } > > Hmm, checking: > > if (sysctl_sched_rt_default_uclamp_util_min > sysctl_sched_uclamp_util_min) > > would probably make sense too, but then that would make writing in > sysctl_sched_uclamp_util_min cumbersome for sysadmins as they'd need to > lower the rt default first. Is that the reason for checking against > SCHED_CAPACITY_SCALE? That might deserve a comment or something. There's no need for that extra diff. That constraint will be applied automatically when calculating the effective value. The check for SCHED_CAPACITY_SCALE is a a range check. The possible value is [0:SCHED_CAPACITY_SCALE]. Does this answer your question? I could add a comment that all the uclamp sysctls need to be within this range. > > <snip> > > @@ -1241,9 +1293,13 @@ static void uclamp_fork(struct task_struct *p) > > for_each_clamp_id(clamp_id) { > > unsigned int clamp_value = uclamp_none(clamp_id); > > > > - /* By default, RT tasks always get 100% boost */ > > + /* > > + * By default, RT tasks always get 100% boost, which the admins > > + * are allowed to change via > > + * sysctl_sched_rt_default_uclamp_util_min knob. > > + */ > > if (unlikely(rt_task(p) && clamp_id == UCLAMP_MIN)) > > - clamp_value = uclamp_none(UCLAMP_MAX); > > + clamp_value = sysctl_sched_rt_default_uclamp_util_min; > > > > uclamp_se_set(&p->uclamp_req[clamp_id], clamp_value, false); > > } > > And that, as per 20200414161320.251897-1-qperret@xxxxxxxxxx, should not > be there :) Yep saw it. Thanks for fixing it! > > Otherwise the patch pretty looks good to me! Cheers -- Qais Yousef