Re: [PATCH v3 06/14] sched/cpufreq: uclamp: add utilization clamping for RT tasks
From: Juri Lelli <juri.lelli@redhat.com>
Date: 2018-08-13 10:50:44
Also in:
lkml
On 13/08/18 11:12, Patrick Bellasi wrote:
Hi Vincent! On 09-Aug 18:03, Vincent Guittot wrote:quoted
quoted
On 07-Aug 15:26, Juri Lelli wrote:[...]quoted
quoted
quoted
quoted
+ util_cfs = cpu_util_cfs(rq); + util_rt = cpu_util_rt(rq); + if (sched_feat(UCLAMP_SCHED_CLASS)) { + util = 0; + if (util_cfs) + util += uclamp_util(cpu_of(rq), util_cfs); + if (util_rt) + util += uclamp_util(cpu_of(rq), util_rt); + } else { + util = cpu_util_cfs(rq); + util += cpu_util_rt(rq); + util = uclamp_util(cpu_of(rq), util); + }Regarding the two policies, do you have any comment?Does the policy for (sched_feat(UCLAMP_SCHED_CLASS)== true) really make sense as it is ? I mean, uclamp_util doesn't make any difference between rt and cfs tasks when clamping the utilization so why should be add twice the returned value ? IMHO, this policy would make sense if there were something like uclamp_util_rt() and a uclamp_util_cfs()The idea for the UCLAMP_SCHED_CLASS policy is to improve fairness on low-priority classese, especially when we have high RT utilization. Let say we have: util_rt = 40%, util_min=0% util_cfs = 10%, util_min=50% the two policies will select: UCLAMP_SCHED_CLASS: util = uclamp(40) + uclamp(10) = 50 + 50 = 100% !UCLAMP_SCHED_CLASS: util = uclamp(40 + 10) = uclmp(50) = 50% Which means that, despite the CPU's util_min will be set to 50% when CFS is running, these tasks will have almost no boost at all, since their bandwidth margin is eclipsed by RT tasks.
Ah, right. But isn't possible to distinguish between classes? I mean, if you would know that only CFS is clamped (boosted) in this case, you could have: util = util_rt + uclamp(util_cfs) = 40 + 50 = 90% Which should do what one expects w/o energy side effects?