Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp35140ybx; Wed, 30 Oct 2019 10:58:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqxZyBhm+Eg4HL+8c+iVxqIsOrdvrhCbV6NKf8ctD0Lo5e/E3E9RiBuHipGp02SLJnKeirOs X-Received: by 2002:a17:906:6993:: with SMTP id i19mr790398ejr.259.1572458334811; Wed, 30 Oct 2019 10:58:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572458334; cv=none; d=google.com; s=arc-20160816; b=rgEP0iJw1C78ZKFPm53gNaKK46pH4BFyp+BYzyiLvGpDerJbEW46cFfSZ2SyOMG+EY wF29321hJnjDuQ91tScOxxrMPr55f9yUV3tlo/GMUoqP9duBSXGj3SgkKHfVz4hIobMy LnC6TUVVGSBblUvdnPodg2LF5BA6IUjX0wk6M4W8tgO/Xyy8NvAzSMucSw9EdKiiNKIi eYMo0SsAzgQgl6LytQ4AfHEkkPeP7kadkM1K+id27W1pOy0NL60GqPzL1LuQnKv7ZFfQ CPW8jBpVdOcOVgTUMt4AXz2A0KB5mk2CmUG6zskxUdXMhCKoC75Sv5EMeuouDSSCwIax DrfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=7mZ3hdtUFZsghSAyhPspAG9N/gAftJ/UKlLExYxE09E=; b=kICRU2J2rAqXO8L0EwJHB5/z+bwP74S3q4P3QP7ZLvDBaHviSvcBCshOmdV3L47XeO GTAdpsCr5DJAR6vy2l0dt3c1gURrQiAT3PldcH5lGNsDZ8rH2LW32GHOEdDYgRuyZn9z 3ZP29N62o+MQWoMhqgc/7knSBfUCMTfx3nGz4BoFmXFTH+YhrLcoR07AYl1RWi4EyNvb H/oMp8QatW64PkaCUMa0V6txi2iGapVXcOUyGklRO1O8rlYg/9pQ1Pawz1zcdsRs7fNT wCdBhPlq/xtQAgkKJqFWjgSGSPAH6/WtSyPiWF+IYc83TuMCkGlj2NSBjNhE8wuOsCV7 TuOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AWLbv+os; 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 sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a55si2111017edc.13.2019.10.30.10.58.18; Wed, 30 Oct 2019 10:58:54 -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 header.s=google header.b=AWLbv+os; 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 sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727165AbfJ3P1X (ORCPT + 99 others); Wed, 30 Oct 2019 11:27:23 -0400 Received: from mail-lj1-f196.google.com ([209.85.208.196]:33650 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726461AbfJ3P1W (ORCPT ); Wed, 30 Oct 2019 11:27:22 -0400 Received: by mail-lj1-f196.google.com with SMTP id t5so3187802ljk.0 for ; Wed, 30 Oct 2019 08:27:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=7mZ3hdtUFZsghSAyhPspAG9N/gAftJ/UKlLExYxE09E=; b=AWLbv+osewTPSi/vLPVd5pQBM/2GgohGKpImcwCHp66lnoHDlebOgO6/T/itPeQt82 lnJEtwhEWqY93eVMkA+vgu4zGeJNEpQQdE4Gjr2d0jJ2ddX5f2mOBY7GysGUwGE0ylRh ezKxa7AM3Gv3oEtBZiauKf4Wc5mzy0a3TBZgSan6bJf2Oy6+EQr701yCG9jJHrms+Jsu Q2B6DA4T/qWPaAp2fnIC7DoaZGV14MtiBA4D8SzpNP2IPwBF8meFCzFU7aNYL8rPdmiL A1VobGpDRWIFP2NrIINA8evRtg4K97nBoVQEpj+Ylm+OK1BbvaHX5rNGiyY4qNjhkbxX C3aA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=7mZ3hdtUFZsghSAyhPspAG9N/gAftJ/UKlLExYxE09E=; b=cyKwICwhHXaJNtxm+ROzE9Wm6nVuWfkn44WHqKcIAoaWHQDbLnZ7uDRrSztDabSPeI U1GtJ4YtLr8zSJZfCpaTLRL2LfHqQv5znZPfREEUnCIN/S7mT/3ENMCxDxVPgd/zFQ+U TF6Uq2xPcDFmkaPQ8CPhViysqTVyvzhD7cyXzr/L+qsS31a8yTTSSbNJ8TUuhkZiPhvd dvjl5cI6HoYa/j+3kL2/JDImzm2Vchbv0dp4pBVamJ/B3zOa6ld+ZFWAtBjGl2wNO1vW hyo5nWfvivL8335KZKrfQ8VA8RArTyfB8MKvMCmNPeTD/A6XTLuGxjRZykD5VBbYw90X RSWg== X-Gm-Message-State: APjAAAVPItB51c+lPH7HkauF80PcIO7/k4XDqrhwqneuPK39CIl1PBbI jWcbYJ7pkzmPq/9j7G/qlaM2X+lEE/C8+q6rWGahSgsfn6w= X-Received: by 2002:a2e:3e18:: with SMTP id l24mr252556lja.48.1572449240686; Wed, 30 Oct 2019 08:27:20 -0700 (PDT) MIME-Version: 1.0 References: <1572018904-5234-1-git-send-email-dsmythies@telus.net> <000c01d58bca$f5709b30$e051d190$@net> <001201d58e68$eaa39630$bfeac290$@net> <20191029160210.GA8343@linaro.org> <000001d58f2a$fc593200$f50b9600$@net> In-Reply-To: <000001d58f2a$fc593200$f50b9600$@net> From: Vincent Guittot Date: Wed, 30 Oct 2019 16:27:08 +0100 Message-ID: Subject: Re: [PATCH] Revert "sched/fair: Fix O(nr_cgroups) in the load balancing path" To: Doug Smythies Cc: linux-kernel , "open list:THERMAL" , Peter Zijlstra , Ingo Molnar , Linus Torvalds , Thomas Gleixner , Sargun Dhillon , Tejun Heo , Xie XiuQi , xiezhipeng1@huawei.com, Srinivas Pandruvada , Rik van Riel Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 30 Oct 2019 at 15:04, Doug Smythies wrote: > > On 2019.10.29 09:02 Vincent Guittot wrote: > > > Could you try the patch below ? It ensures that at least the root cfs rq stays > > in the list so each time update_blocked_averages is called, we will call update_cfs_rq_load_avg() > > for the root cfs_rq at least and even if everything already reach zero. > > This will ensure that cfs_rq_util_change is called even if nothing has > > changed. > > > > --- > > kernel/sched/fair.c | 5 +++++ > > 1 file changed, 5 insertions(+) > > > > diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c > > index 151c0b7..ac0a549 100644 > > --- a/kernel/sched/fair.c > > +++ b/kernel/sched/fair.c > > @@ -7552,6 +7552,8 @@ static inline void update_blocked_load_status(struct rq *rq, bool has_blocked) { > > > > static inline bool cfs_rq_is_decayed(struct cfs_rq *cfs_rq) > > { > > + struct rq *rq = rq_of(cfs_rq); > > + > > if (cfs_rq->load.weight) > > return false; > > > > @@ -7564,6 +7566,9 @@ static inline bool cfs_rq_is_decayed(struct cfs_rq *cfs_rq) > > if (cfs_rq->avg.runnable_load_sum) > > return false; > > > > + if (cfs_rq == &rq->cfs) > > + return false; > > + > > return true; > > } > > > > -- > > 2.7.4 > > Yes, this patch works and solves the long time > between calls of the intel_pstate CPU frequency scaling > driver issue. > I see you sent a formal patch a few hours ago. > I'll try it and report back. The patch that I sent a few hours ago, doesn't solve your problem. It solves item 1 of my previous email. The fact that this hack fix your problem means that Intel pstate needs to be called periodically even if the cfs pelt signals are null and this is probably linked to the internal state machine of the driver. The current behavior for CFS makes perfectly sense because cfs signal is already null so we don't need to update freq because of cfs' signal Then it remains the rt, dl and irq signals which might not be null yet and which doesn't trigger a call to cpufreq_update_util whereas it could worth calling it. I have to prepare a patch for this part which is item 2 Regards, Vincent > > ... Doug > >