From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932356AbbJMDVS (ORCPT ); Mon, 12 Oct 2015 23:21:18 -0400 Received: from mga02.intel.com ([134.134.136.20]:26507 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932137AbbJMDVR (ORCPT ); Mon, 12 Oct 2015 23:21:17 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,676,1437462000"; d="scan'208";a="825491241" Date: Tue, 13 Oct 2015 03:32:47 +0800 From: Yuyang Du To: Peter Zijlstra Cc: Mike Galbraith , linux-kernel@vger.kernel.org Subject: Re: 4.3 group scheduling regression Message-ID: <20151012193247.GL11102@intel.com> References: <20151010170142.GI3816@twins.programming.kicks-ass.net> <1444530318.3363.40.camel@gmail.com> <1444585321.4169.18.camel@gmail.com> <20151012072344.GM3604@twins.programming.kicks-ass.net> <1444635897.3425.19.camel@gmail.com> <20151012080407.GJ3816@twins.programming.kicks-ass.net> <20151012005351.GJ11102@intel.com> <20151012091206.GK3816@twins.programming.kicks-ass.net> <20151012021230.GK11102@intel.com> <20151012114723.GL3816@twins.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20151012114723.GL3816@twins.programming.kicks-ass.net> 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 Mon, Oct 12, 2015 at 01:47:23PM +0200, Peter Zijlstra wrote: > > Also, should we do the below? At this point se->on_rq is still 0 so > reweight_entity() will not update (dequeue/enqueue) the accounting, but > we'll have just accounted the 'old' load.weight. > > Doing it this way around we'll first update the weight and then account > it, which seems more accurate. I think the original looks ok. The account_entity_enqueue() adds child entity's load.weight to parent's load: update_load_add(&cfs_rq->load, se->load.weight) Then recalculate the shares. Then reweight_entity() resets the parent entity's load.weight. > --- > diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c > index 700eb548315f..d2efef565aed 100644 > --- a/kernel/sched/fair.c > +++ b/kernel/sched/fair.c > @@ -3009,8 +3009,8 @@ enqueue_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int flags) > */ > update_curr(cfs_rq); > enqueue_entity_load_avg(cfs_rq, se); > - account_entity_enqueue(cfs_rq, se); > update_cfs_shares(cfs_rq); > + account_entity_enqueue(cfs_rq, se); > > if (flags & ENQUEUE_WAKEUP) { > place_entity(cfs_rq, se, 0);