On Thu, Jan 18, 2018 at 03:54:12PM +0530, Viresh Kumar wrote:
On 18-01-18, 10:17, Quentin Perret wrote:
I think this is precisely what is done in cpu_util_wake() no ?
Looks like I completely misread it, damn.
+static int cpu_util_wake(int cpu, struct task_struct *p) +{
unsigned long util, capacity;
+#ifdef CONFIG_SCHED_WALT
/*
* WALT does not decay idle tasks in the same manner
* as PELT, so it makes little sense to subtract task
* utilization from cpu utilization. Instead just use
* cpu_util for this case.
*/
if (!walt_disabled && sysctl_sched_use_walt_cpu_util &&
p->state == TASK_WAKING)
return cpu_util(cpu);
I somehow read it as if we will always return from here and never execute the below code for walt.
+#endif
/* Task has no contribution or is new */
if (cpu != task_cpu(p) || !p->se.avg.last_update_time)
return cpu_util(cpu);
capacity = capacity_orig_of(cpu);
util = max_t(long, cpu_util(cpu) - task_util(p), 0);
return (util >= capacity) ? capacity : util;
+}
Sorry for the noise, there shouldn't be double accounting here.
Right. There is no double accounting here. cpu_util() i.e WALT's cumulative_runnable_avg represents the sum of demands of tasks queued on a given CPU. So we don't have to discount anything for waking tasks. select_best_target() is also called from tick path to see if the current task needs to be migrated to the BIG cluster. In that case, we have to discount the task's utilization which is being done here.
-- Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc. Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.