From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932909AbcFBP7K (ORCPT ); Thu, 2 Jun 2016 11:59:10 -0400 Received: from foss.arm.com ([217.140.101.70]:46255 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1161223AbcFBP7I (ORCPT ); Thu, 2 Jun 2016 11:59:08 -0400 Subject: Re: [RFC PATCH 3/3] sched/fair: Change @running of __update_load_avg() to @update_util To: Peter Zijlstra References: <1464809962-25814-1-git-send-email-dietmar.eggemann@arm.com> <1464809962-25814-4-git-send-email-dietmar.eggemann@arm.com> <20160601201149.GO3193@twins.programming.kicks-ass.net> Cc: linux-kernel@vger.kernel.org, Vincent Guittot , Ben Segall , Morten Rasmussen , Yuyang Du From: Dietmar Eggemann Message-ID: <575057C9.8000403@arm.com> Date: Thu, 2 Jun 2016 16:59:05 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0 MIME-Version: 1.0 In-Reply-To: <20160601201149.GO3193@twins.programming.kicks-ass.net> 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 01/06/16 21:11, Peter Zijlstra wrote: > On Wed, Jun 01, 2016 at 08:39:22PM +0100, Dietmar Eggemann wrote: >> The information whether a se/cfs_rq should get its load and >> utilization (se representing a task and root cfs_rq) or only its load >> (se representing a task group and cfs_rq owned by this se) updated can >> be passed into __update_load_avg() to avoid the additional if/else >> condition to set update_util. >> >> @running is changed to @update_util which now carries the information if >> the utilization of the se/cfs_rq should be updated and if the se/cfs_rq >> is running or not. >> >> Signed-off-by: Dietmar Eggemann >> --- >> kernel/sched/fair.c | 42 +++++++++++++++++++++--------------------- >> 1 file changed, 21 insertions(+), 21 deletions(-) >> >> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c >> index 3ae8e79fb687..a1c13975cf56 100644 >> --- a/kernel/sched/fair.c >> +++ b/kernel/sched/fair.c >> @@ -2669,6 +2669,10 @@ static u32 __compute_runnable_contrib(u64 n) >> >> #define cap_scale(v, s) ((v)*(s) >> SCHED_CAPACITY_SHIFT) >> >> +#define upd_util_se(se, rng) ((entity_is_task(se) << 1) | (rng)) > > Just saying that on first reading that went: Random Number Generator, uh > what?! > > So maybe pick better names? Yeah, can do. What about? #define update_util_se(se, running) ((entity_is_task(se) << 1) | (running)) #define update_util_rq(cfs_rq) ((rq_is_root(cfs_rq) << 1) | !!(cfs_rq)->curr)