Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1307115ybt; Thu, 25 Jun 2020 02:57:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw0B8P39crc96jphdQXPDWR61nicRnb/KpaeVNFYjBSdov+h6lLIvZbnwxrwgI2rjC79/Yi X-Received: by 2002:a17:907:405e:: with SMTP id ns22mr478933ejb.6.1593079036720; Thu, 25 Jun 2020 02:57:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593079036; cv=none; d=google.com; s=arc-20160816; b=N5EKYy352YpWvNFd+jUyaGYAevmp1BBKaN6FsYzzf65YyzQsG8F1k2xjRSWBCGruVp QFnKy/eLYkTzC4XbPgrUHWU+++5dwVXsGLQRZMcQyYk59RE1/X607rZV/2I+0XIeYiU3 mWAZyGRAxTaeSZhUtZco/C1nd4yGZxIybHEPXqzDev5Lh2b3XC65ySexzhnl4uJFlR0u JzURUZcI14S/8Qm3iDyLue05yq9URrMg61Mu8EoiqnRiUOBjX3OD+l1zetBAa7ZvMNUx LMbw0/q6ITTxuGXJhxiy8iqEUDP6L/JEdjOWWxftVRol7y6r+lZzOTQTGNdV8M9bt9lH TXsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:date:message-id :organization:from:references:cc:to:subject; bh=RtQCc353DK7I9i9K8yQ0G9sfJ4VcUeSksDUSzQt8QAQ=; b=JuxT3Z68yvzPUYc8GlwgbutPz7EKK2g5cU65hwtp2a/ytyjAV2fjLoPSqayL8fO2dd vFquakh8FImYCq0BIwbu2eOLxypKYFIFX/aGw1qg0oVet3NkWiLUSMmXXt2nJdXMLIRT abm8qavFUgmIIT0UTxCTb8ZSY06VeL0GGOUbMRDx7wyLR/xJ4B3Ag7GgIkZnUB2kx6U/ kezucI+5F+7p2i8+GIqA8TexhYyIq7uFAAOs0ItGgw7st0iixhmpOs8yGYzNZ87yLvJI 5/3r8f+JDSLkWZixzWRp9s2+3aviHwAMj/wZ5N+3k7e1vrV/uxJytTozPGu6TVkFdY+j +P0Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id do22si17907113ejc.79.2020.06.25.02.56.52; Thu, 25 Jun 2020 02:57:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2403850AbgFYJYb (ORCPT + 99 others); Thu, 25 Jun 2020 05:24:31 -0400 Received: from mail.itouring.de ([188.40.134.68]:35164 "EHLO mail.itouring.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390836AbgFYJYb (ORCPT ); Thu, 25 Jun 2020 05:24:31 -0400 Received: from tux.applied-asynchrony.com (p5ddd79e0.dip0.t-ipconnect.de [93.221.121.224]) by mail.itouring.de (Postfix) with ESMTPSA id F17F2416080F; Thu, 25 Jun 2020 11:24:29 +0200 (CEST) Received: from [192.168.100.223] (ragnarok.applied-asynchrony.com [192.168.100.223]) by tux.applied-asynchrony.com (Postfix) with ESMTP id E7745F01605; Thu, 25 Jun 2020 11:24:28 +0200 (CEST) Subject: Re: [PATCH] sched/cfs: change initial value of runnable_avg To: Vincent Guittot , mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, linux-kernel@vger.kernel.org, rong.a.chen@intel.com Cc: valentin.schneider@arm.com, pauld@redhat.com, hdanton@sina.com References: <20200624154422.29166-1-vincent.guittot@linaro.org> From: =?UTF-8?Q?Holger_Hoffst=c3=a4tte?= Organization: Applied Asynchrony, Inc. Message-ID: <7f2b3135-328b-a510-ce23-49e3f5c20965@applied-asynchrony.com> Date: Thu, 25 Jun 2020 11:24:28 +0200 MIME-Version: 1.0 In-Reply-To: <20200624154422.29166-1-vincent.guittot@linaro.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020-06-24 17:44, Vincent Guittot wrote: > Some performance regression on reaim benchmark have been raised with > commit 070f5e860ee2 ("sched/fair: Take into account runnable_avg to classify group") > > The problem comes from the init value of runnable_avg which is initialized > with max value. This can be a problem if the newly forked task is finally > a short task because the group of CPUs is wrongly set to overloaded and > tasks are pulled less agressively. > > Set initial value of runnable_avg equals to util_avg to reflect that there > is no waiting time so far. > > Fixes: 070f5e860ee2 ("sched/fair: Take into account runnable_avg to classify group") > Reported-by: kernel test robot > Signed-off-by: Vincent Guittot > --- > kernel/sched/fair.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c > index 0424a0af5f87..45e467bf42fc 100644 > --- a/kernel/sched/fair.c > +++ b/kernel/sched/fair.c > @@ -806,7 +806,7 @@ void post_init_entity_util_avg(struct task_struct *p) > } > } > > - sa->runnable_avg = cpu_scale; > + sa->runnable_avg = sa->util_avg; > > if (p->sched_class != &fair_sched_class) { > /* > Something is wrong here. I woke up my machine from suspend-to-RAM this morning and saw that a completely idle machine had a loadavg of ~7. According to my monitoring system this happened to be the loadavg right before I suspended. I've reverted this, rebooted, created a loadavg >0, suspended and after wake up loadavg again correctly ranges between 0 and whatever, as expected. -h