From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752263AbcFVLq5 (ORCPT ); Wed, 22 Jun 2016 07:46:57 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:58207 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751390AbcFVLqz (ORCPT ); Wed, 22 Jun 2016 07:46:55 -0400 Date: Wed, 22 Jun 2016 13:46:04 +0200 From: Peter Zijlstra To: Vincent Guittot Cc: Dietmar Eggemann , Yuyang Du , Ingo Molnar , linux-kernel , Mike Galbraith , Benjamin Segall , Paul Turner , Morten Rasmussen , Matt Fleming Subject: Re: [PATCH 4/4] sched,fair: Fix PELT integrity for new tasks Message-ID: <20160622114604.GF30154@twins.programming.kicks-ass.net> References: <20160617142814.GT30154@twins.programming.kicks-ass.net> <20160617160239.GL30927@twins.programming.kicks-ass.net> <20160617161831.GM30927@twins.programming.kicks-ass.net> <5767D51F.3080600@arm.com> <5768027E.1090408@arm.com> <20160621084119.GN30154@twins.programming.kicks-ass.net> <20160621131746.GR30927@twins.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23.1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 21, 2016 at 03:29:49PM +0200, Vincent Guittot wrote: > > --- a/kernel/sched/fair.c > > +++ b/kernel/sched/fair.c > > @@ -692,6 +692,7 @@ void init_entity_runnable_average(struct > > > > static inline u64 cfs_rq_clock_task(struct cfs_rq *cfs_rq); > > static int update_cfs_rq_load_avg(u64 now, struct cfs_rq *cfs_rq, bool update_freq); > > +static void update_tg_load_avg(struct cfs_rq *cfs_rq, int force); > > static void attach_entity_load_avg(struct cfs_rq *cfs_rq, struct sched_entity *se); > > > > /* > > @@ -757,7 +758,8 @@ void post_init_entity_util_avg(struct sc > > } > > } > > > > - update_cfs_rq_load_avg(now, cfs_rq, false); > > + if (update_cfs_rq_load_avg(now, cfs_rq, false)) > > + update_tg_load_avg(cfs_rq, false); > > You should move update_tg_load_avg after attach_entity_load_avg to > take into account the newly attached task Right you are, I've also updated the comment to reflect this.