From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753941AbdEQOiK (ORCPT ); Wed, 17 May 2017 10:38:10 -0400 Received: from merlin.infradead.org ([205.233.59.134]:48300 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752633AbdEQOiG (ORCPT ); Wed, 17 May 2017 10:38:06 -0400 Date: Wed, 17 May 2017 16:20:10 +0200 From: Peter Zijlstra To: Vincent Guittot Cc: Ingo Molnar , linux-kernel , Tejun Heo , Linus Torvalds , Mike Galbraith , Paul Turner , Chris Mason , Dietmar Eggemann , Morten Rasmussen , Ben Segall , Yuyang Du Subject: Re: [RFC][PATCH 03/14] sched/fair: Remove se->load.weight from se->avg.load_sum Message-ID: <20170517142010.pooe6iipiv43ubul@hirez.programming.kicks-ass.net> References: <20170512164416.108843033@infradead.org> <20170512171335.652765152@infradead.org> <20170517095045.GA8420@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20170517095045.GA8420@linaro.org> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 17, 2017 at 11:50:45AM +0200, Vincent Guittot wrote: > Le Wednesday 17 May 2017 à 09:04:47 (+0200), Vincent Guittot a écrit : > > I wonder if there is a problem with this new way to compute se's > > load_avg and cfs_rq's load_avg when a task changes is nice prio before > > migrating to another CPU. > > > > se load_avg is now: runnable x current weight > > but cfs_rq load_avg keeps the history of the previous weight of the se > > When we detach se, we will remove an up to date se's load_avg from > > cfs_rq which doesn't have the up to date load_avg in its own load_avg. > > So if se's prio decreases just before migrating, some load_avg stays > > in prev cfs_rq and if se's prio increases, we will remove too much > > load_avg and possibly make the cfs_rq load_avg null whereas other > > tasks are running. > > > > Thought ? > > > > I'm able to reproduce the problem with a simple rt-app use case (after > > adding a new feature in rt-app) > > > > Vincent > > > > The hack below fixes the problem I mentioned above. It applies on task what is > done when updating group_entity's weight Right. I didn't think people much used nice so I skipped it for now. Yes your patch looks about right for that. I'll include it, thanks!