From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752690AbcFCKzo (ORCPT ); Fri, 3 Jun 2016 06:55:44 -0400 Received: from foss.arm.com ([217.140.101.70]:51650 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752422AbcFCKzn (ORCPT ); Fri, 3 Jun 2016 06:55:43 -0400 Date: Fri, 3 Jun 2016 11:56:07 +0100 From: Juri Lelli To: Dietmar Eggemann Cc: Peter Zijlstra , linux-kernel@vger.kernel.org, Vincent Guittot , Ben Segall , Morten Rasmussen , Yuyang Du Subject: Re: [RFC PATCH 3/3] sched/fair: Change @running of __update_load_avg() to @update_util Message-ID: <20160603105607.GJ9340@e106622-lin> References: <1464809962-25814-1-git-send-email-dietmar.eggemann@arm.com> <1464809962-25814-4-git-send-email-dietmar.eggemann@arm.com> <20160602092539.GD9340@e106622-lin> <57506C8B.4050407@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <57506C8B.4050407@arm.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/06/16 18:27, Dietmar Eggemann wrote: > On 02/06/16 10:25, Juri Lelli wrote: > > [...] > > >> @@ -2757,7 +2754,7 @@ __update_load_avg(u64 now, int cpu, struct sched_avg *sa, > >> weight * scaled_delta_w; > >> } > >> } > >> - if (update_util && running) > >> + if (update_util == 0x3) > > > > How about a define for these masks? > > Something like this? > > +#define UTIL_RUNNING 1 > +#define UTIL_UPDATE 2 Make these 0x01 and 0x02, I'd say. > + > /* > * We can represent the historical contribution to runnable average as the > * coefficients of a geometric series. To do this we sub-divide our runnable > @@ -2724,7 +2727,7 @@ static u32 __compute_runnable_contrib(u64 n) > */ > static __always_inline int > __update_load_avg(u64 now, int cpu, struct sched_avg *sa, > - unsigned long weight, int update_util, struct cfs_rq *cfs_rq) > + unsigned long weight, int util_flags, struct cfs_rq *cfs_rq) > { > u64 delta, scaled_delta, periods; > u32 contrib; > @@ -2775,7 +2778,7 @@ __update_load_avg(u64 now, int cpu, struct sched_avg *sa, > weight * scaled_delta_w; > } > } > - if (update_util == 0x3) > + if (util_flags == (UTIL_UPDATE | UTIL_RUNNING)) Looks more readable to me. :-) Best, - Juri