Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751616AbbBKIva (ORCPT ); Wed, 11 Feb 2015 03:51:30 -0500 Received: from e39.co.us.ibm.com ([32.97.110.160]:35675 "EHLO e39.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750923AbbBKIv3 (ORCPT ); Wed, 11 Feb 2015 03:51:29 -0500 Message-ID: <54DB17CC.6050009@linux.vnet.ibm.com> Date: Wed, 11 Feb 2015 14:20:20 +0530 From: Preeti U Murthy User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Morten Rasmussen , peterz@infradead.org, mingo@redhat.com, vincent.guittot@linaro.org CC: dietmar.eggemann@arm.com, yuyang.du@intel.com, mturquette@linaro.org, nico@linaro.org, rjw@rjwysocki.net, juri.lelli@arm.com, linux-kernel@vger.kernel.org, Paul Turner , Ben Segall Subject: Re: [RFCv3 PATCH 01/48] sched: add utilization_avg_contrib References: <1423074685-6336-1-git-send-email-morten.rasmussen@arm.com> <1423074685-6336-2-git-send-email-morten.rasmussen@arm.com> In-Reply-To: <1423074685-6336-2-git-send-email-morten.rasmussen@arm.com> Content-Type: text/plain; charset=ISO-8859-6 Content-Transfer-Encoding: 7bit X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15021108-0033-0000-0000-0000039FD319 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2567 Lines: 67 On 02/05/2015 12:00 AM, Morten Rasmussen wrote: > From: Vincent Guittot > > Add new statistics which reflect the average time a task is running on the CPU > and the sum of these running time of the tasks on a runqueue. The latter is > named utilization_load_avg. > > This patch is based on the usage metric that was proposed in the 1st > versions of the per-entity load tracking patchset by Paul Turner > but that has be removed afterwards. This version differs from > the original one in the sense that it's not linked to task_group. > > The rq's utilization_load_avg will be used to check if a rq is overloaded or > not instead of trying to compute how many tasks a group of CPUs can handle. > > Rename runnable_avg_period into avg_period as it is now used with both > runnable_avg_sum and running_avg_sum > > Add some descriptions of the variables to explain their differences > > cc: Paul Turner > cc: Ben Segall > > Signed-off-by: Vincent Guittot > Acked-by: Morten Rasmussen > --- > include/linux/sched.h | 21 ++++++++++++--- > kernel/sched/debug.c | 10 ++++--- > kernel/sched/fair.c | 74 ++++++++++++++++++++++++++++++++++++++++----------- > kernel/sched/sched.h | 8 +++++- > 4 files changed, 89 insertions(+), 24 deletions(-) > +static inline void __update_task_entity_utilization(struct sched_entity *se) > +{ > + u32 contrib; > + > + /* avoid overflowing a 32-bit type w/ SCHED_LOAD_SCALE */ > + contrib = se->avg.running_avg_sum * scale_load_down(SCHED_LOAD_SCALE); > + contrib /= (se->avg.avg_period + 1); > + se->avg.utilization_avg_contrib = scale_load(contrib); > +} > + > +static long __update_entity_utilization_avg_contrib(struct sched_entity *se) > +{ > + long old_contrib = se->avg.utilization_avg_contrib; > + > + if (entity_is_task(se)) > + __update_task_entity_utilization(se); > + > + return se->avg.utilization_avg_contrib - old_contrib; When the entity is not a task, shouldn't the utilization_avg_contrib be updated like this : se->avg.utilization_avg_contrib = group_cfs_rq(se)->utilization_load_avg ? and then the delta with old_contrib be passed ? Or is this being updated someplace that I have missed ? Regards Preeti U Murthy -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/