From patchwork Tue Oct 18 11:56:51 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Vincent Guittot X-Patchwork-Id: 78004 Delivered-To: patch@linaro.org Received: by 10.140.97.247 with SMTP id m110csp844132qge; Tue, 18 Oct 2016 04:57:15 -0700 (PDT) X-Received: by 10.98.159.70 with SMTP id g67mr87316pfe.62.1476791835493; Tue, 18 Oct 2016 04:57:15 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w19si32035007pgc.263.2016.10.18.04.57.15; Tue, 18 Oct 2016 04:57:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759558AbcJRL5F (ORCPT + 27 others); Tue, 18 Oct 2016 07:57:05 -0400 Received: from mail-qt0-f173.google.com ([209.85.216.173]:36233 "EHLO mail-qt0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752128AbcJRL4z (ORCPT ); Tue, 18 Oct 2016 07:56:55 -0400 Received: by mail-qt0-f173.google.com with SMTP id m5so148976462qtb.3 for ; Tue, 18 Oct 2016 04:56:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=Hqfe09ofIUDpPAeLjmymt6wnWacGcl36g9MkU8yx2dE=; b=UuAhW4FXKZET9tEoTkrukUbY2XVOSLs7ffILs3BwovllTvDJyd/xzKBU9Q6oso1JB1 12Nli4IkBAX14QW7WSg6N60UKzfzbv8vYu6Fy+PlVrCBnSc4eCBtXGQbZnScWNBbQgQg rnHBSpoOuWtMl/7tixqK4kE6mjRlYuuqOIVpM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=Hqfe09ofIUDpPAeLjmymt6wnWacGcl36g9MkU8yx2dE=; b=RYg7ramZsvK3cfAfQfXd04ULs5jZkJ8JtwYnfqYnRduHVXfw93dGCNl1ZlfASqgh5J 8jIZePAemkfDKpvA+bLWKNIpHpznOR1/8tIxj25AxGy8e7deenHmcrYIX8zGaueM2fsv TGsksVoHX5u6xX5xwtHIYcfaS1DSJQAn17vmkXEYhYK0ZRBI8EqY635CsrESxmg7HtFC GvH8/l1Nzi7epeTSGGtHtjN3jh2C4n8vrI+1tlEGMtprZfv0ws29k2FcVnqlHttjAe/b DVgZsiErhgSazybijh3geGN77U8ZDfGlg0qs6ne7BS+9ZcOF0a54/bva8OnBWXQ8IJAF FZwQ== X-Gm-Message-State: AA6/9Rm6fujMc/9zKjB7cKy5wUoM7rva0JPvw7cJijtLyzDYM+k3uL974M9mLJN8sjl6/oOa X-Received: by 10.28.45.198 with SMTP id t189mr11846591wmt.52.1476791814686; Tue, 18 Oct 2016 04:56:54 -0700 (PDT) Received: from linaro.org ([2a01:e35:8bd4:7750:340f:841b:f872:1189]) by smtp.gmail.com with ESMTPSA id a7sm59076172wjj.22.2016.10.18.04.56.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 18 Oct 2016 04:56:53 -0700 (PDT) Date: Tue, 18 Oct 2016 13:56:51 +0200 From: Vincent Guittot To: Peter Zijlstra Cc: Dietmar Eggemann , Joseph Salisbury , Ingo Molnar , Linus Torvalds , Thomas Gleixner , LKML , Mike Galbraith , omer.akram@canonical.com Subject: Re: [v4.8-rc1 Regression] sched/fair: Apply more PELT fixes Message-ID: <20161018115651.GA20956@linaro.org> References: <20161014151827.GA10379@linaro.org> <2bb765e7-8a5f-c525-a6ae-fbec6fae6354@canonical.com> <20161017090903.GA11962@linaro.org> <4e15ad55-beeb-e860-0420-8f439d076758@arm.com> <20161017131952.GR3117@twins.programming.kicks-ass.net> <94cc6deb-f93e-60ec-5834-e84a8b98e73c@arm.com> <20161018090747.GW3142@twins.programming.kicks-ass.net> <20161018103412.GT3117@twins.programming.kicks-ass.net> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20161018103412.GT3117@twins.programming.kicks-ass.net> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le Tuesday 18 Oct 2016 à 12:34:12 (+0200), Peter Zijlstra a écrit : > On Tue, Oct 18, 2016 at 11:45:48AM +0200, Vincent Guittot wrote: > > On 18 October 2016 at 11:07, Peter Zijlstra wrote: > > > So aside from funny BIOSes, this should also show up when creating > > > cgroups when you have offlined a few CPUs, which is far more common I'd > > > think. > > > > The problem is also that the load of the tg->se[cpu] that represents > > the tg->cfs_rq[cpu] is initialized to 1024 in: > > alloc_fair_sched_group > > for_each_possible_cpu(i) { > > init_entity_runnable_average(se); > > sa->load_avg = scale_load_down(se->load.weight); > > > > Initializing sa->load_avg to 1024 for a newly created task makes > > sense as we don't know yet what will be its real load but i'm not sure > > that we have to do the same for se that represents a task group. This > > load should be initialized to 0 and it will increase when task will be > > moved/attached into task group > > Yes, I think that makes sense, not sure how horrible that is with the That should not be that bad because this initial value is only useful for the few dozens of ms that follow the creation of the task group > > current state of things, but after your propagate patch, that > reinstates the interactivity hack that should work for sure. The patch below fixes the issue on my platform: Dietmar, Omer can you confirm that this fix the problem of your platform too ? --- kernel/sched/fair.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) Tested-by: Dietmar Eggemann Tested-by: Joonwoo Park diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 8b03fb5..89776ac 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -690,7 +690,14 @@ void init_entity_runnable_average(struct sched_entity *se) * will definitely be update (after enqueue). */ sa->period_contrib = 1023; - sa->load_avg = scale_load_down(se->load.weight); + /* + * Tasks are intialized with full load to be seen as heavy task until + * they get a chance to stabilize to their real load level. + * group entity are intialized with null load to reflect the fact that + * nothing has been attached yet to the task group. + */ + if (entity_is_task(se)) + sa->load_avg = scale_load_down(se->load.weight); sa->load_sum = sa->load_avg * LOAD_AVG_MAX; /* * At this point, util_avg won't be used in select_task_rq_fair anyway