From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752018AbbCYX40 (ORCPT ); Wed, 25 Mar 2015 19:56:26 -0400 Received: from hqemgate16.nvidia.com ([216.228.121.65]:5541 "EHLO hqemgate16.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750979AbbCYX4Z (ORCPT ); Wed, 25 Mar 2015 19:56:25 -0400 X-PGP-Universal: processed; by hqnvupgp07.nvidia.com on Wed, 25 Mar 2015 16:54:17 -0700 Message-ID: <551349D0.8070402@nvidia.com> Date: Wed, 25 Mar 2015 16:50:40 -0700 From: Sai Gurrappadi User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: Morten Rasmussen , "peterz@infradead.org" , "mingo@redhat.com" CC: "vincent.guittot@linaro.org" , Dietmar Eggemann , "yuyang.du@intel.com" , "preeti@linux.vnet.ibm.com" , "mturquette@linaro.org" , "nico@linaro.org" , "rjw@rjwysocki.net" , Juri Lelli , "linux-kernel@vger.kernel.org" , Peter Boonstoppel Subject: Re: [RFCv3 PATCH 43/48] sched: Introduce energy awareness into detach_tasks References: <1423074685-6336-1-git-send-email-morten.rasmussen@arm.com> <1423074685-6336-44-git-send-email-morten.rasmussen@arm.com> In-Reply-To: <1423074685-6336-44-git-send-email-morten.rasmussen@arm.com> X-NVConfidentiality: public Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/04/2015 10:31 AM, Morten Rasmussen wrote: > From: Dietmar Eggemann > while (!list_empty(tasks)) { > @@ -6121,6 +6121,20 @@ static int detach_tasks(struct lb_env *env) > if (!can_migrate_task(p, env)) > goto next; > > + if (env->use_ea) { > + struct energy_env eenv = { > + .src_cpu = env->src_cpu, > + .dst_cpu = env->dst_cpu, > + .usage_delta = task_utilization(p), > + }; > + int e_diff = energy_diff(&eenv); > + > + if (e_diff >= 0) > + goto next; > + > + goto detach; > + } > + > load = task_h_load(p); > > if (sched_feat(LB_MIN) && load < 16 && !env->sd->nr_balance_failed) > @@ -6129,6 +6143,7 @@ static int detach_tasks(struct lb_env *env) > if ((load / 2) > env->imbalance) > goto next; > > +detach: > detach_task(p, env); > list_add(&p->se.group_node, &env->tasks); Hi Morten, Dietmar, Wouldn't the above energy_diff() use the 'old' value of dst_cpu's util? Tasks are detached/dequeued in this loop so they have their util contrib. removed from src_cpu but their contrib. hasn't been added to dst_cpu yet (happens in attach_tasks). Thanks, -Sai