Received: by 10.213.65.68 with SMTP id h4csp3743959imn; Tue, 10 Apr 2018 04:07:53 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/GkJ0MaqiF1m3HxqK/sjP5j1pPHMQQAteBm6RKyQ+agVkcphzOLcF+zaSuEmsY1wSJt77K X-Received: by 10.98.67.217 with SMTP id l86mr2413913pfi.40.1523358473082; Tue, 10 Apr 2018 04:07:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523358473; cv=none; d=google.com; s=arc-20160816; b=hkM9smIicAoDcBpumhULTznKkIBNE4xTKXcv48rTK7ETsBILfdGl+lehhGrmpvoTZ/ 94slODbUybBJZKR45uSytcG22IZacG3Z+ek6wRdYEf4VPU7k7AOn9qRycLcck+hM2jIz n9P5gjMWCk6Bm35qL5hsYtqLsz3tTdGPH4mepwnmn77SGra1VWroAYlcIHmvWRna74tT OBEtl+CUCRrQS4v6E1OzRK5YgRFVS+TF0Wny0f6Xxfxn/OuwGZBmduIdhUXtHJLXuG1I cx3xJtaFkzg7KcgSB/MPN9rx66+z6k6qL8qz0QdxnKVuTB9HCemRxBIfPGptzPjoNVTb C/Ag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=+QvCyyJiKwoKRn9roP1/NfZ8zfw/uy2eBBZ9ptsaVIY=; b=wERJAf9m5Zw3qROYmS4fdhH6tH07QOOntbfJVmu7+OMVo4WZgKTwkZnjtclHzBTPsd E089E6AJfJSBEfsAePpnzzx36PprnxUWDaMNdQ/+HdqpK9JLClbq0gulKjyuo2uaPTVS OtLofpRaYhObuPkbV/tsQC6kluswdhy1q/Rv5bAKcNjrqFvT0MYMfaMPgwmGoIFmV67X C0ddHbISTHiYnglJ+KUJk7dEpvrWoQv8X27tTjxEQDIGEx9B95bO37qDh479MfYPTjf8 VEMlWvl6agqQf6HBBmfl4d8B5jWq/bcy0QKoKnlAYoM8iSwhiHbfhAwlRze7gFTyKlwf wzPw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m65si1973546pfb.130.2018.04.10.04.07.16; Tue, 10 Apr 2018 04:07:53 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752692AbeDJLET (ORCPT + 99 others); Tue, 10 Apr 2018 07:04:19 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:36626 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752368AbeDJLER (ORCPT ); Tue, 10 Apr 2018 07:04:17 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 69E041435; Tue, 10 Apr 2018 04:04:17 -0700 (PDT) Received: from e110439-lin (e110439-lin.cambridge.arm.com [10.1.210.68]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 590103F24A; Tue, 10 Apr 2018 04:04:15 -0700 (PDT) Date: Tue, 10 Apr 2018 12:04:12 +0100 From: Patrick Bellasi To: Vincent Guittot Cc: Peter Zijlstra , linux-kernel , "open list:THERMAL" , Ingo Molnar , "Rafael J . Wysocki" , Viresh Kumar , Juri Lelli , Joel Fernandes , Steve Muckle , Dietmar Eggemann , Morten Rasmussen Subject: Re: [PATCH] sched/fair: schedutil: update only with all info available Message-ID: <20180410110412.GG14248@e110439-lin> References: <20180406172835.20078-1-patrick.bellasi@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Hi Vincent, On 09-Apr 10:51, Vincent Guittot wrote: > Hi Patrick > > On 6 April 2018 at 19:28, Patrick Bellasi wrote: > > Schedutil is not properly updated when the first FAIR task wakes up on a > > CPU and when a RQ is (un)throttled. This is mainly due to the current > > integration strategy, which relies on updates being triggered implicitly > > each time a cfs_rq's utilization is updated. > > > > Those updates are currently provided (mainly) via > > cfs_rq_util_change() > > which is used in: > > - update_cfs_rq_load_avg() > > when the utilization of a cfs_rq is updated > > - {attach,detach}_entity_load_avg() > > This is done based on the idea that "we should callback schedutil > > frequently enough" to properly update the CPU frequency at every > > utilization change. > > > > Since this recent schedutil update: > > > > commit 8f111bc357aa ("cpufreq/schedutil: Rewrite CPUFREQ_RT support") > > > > we use additional RQ information to properly account for FAIR tasks > > utilization. Specifically, cfs_rq::h_nr_running has to be non-zero > > in sugov_aggregate_util() to sum up the cfs_rq's utilization. > > Isn't the use of cfs_rq::h_nr_running, the root cause of the problem ? Not really... > I can now see a lot a frequency changes on my hikey with this new > condition in sugov_aggregate_util(). > With a rt-app UC that creates a periodic cfs task, I have a lot of > frequency changes instead of staying at the same frequency I don't remember a similar behavior... but I'll check better. > Peter, > what was your goal with adding the condition "if > (rq->cfs.h_nr_running)" for the aggragation of CFS utilization The original intent was to get rid of sched class flags, used to track which class has tasks runnable from within schedutil. The reason was to solve some misalignment between scheduler class status and schedutil status. The solution, initially suggested by Viresh, and finally proposed by Peter was to exploit RQ knowledges directly from within schedutil. The problem is that now schedutil updated depends on two information: utilization changes and number of RT and CFS runnable tasks. Thus, using cfs_rq::h_nr_running is not the problem... it's actually part of a much more clean solution of the code we used to have. The problem, IMO is that we now depend on other information which needs to be in sync before calling schedutil... and the patch I proposed is meant to make it less likely that all the information required are not aligned (also in the future). -- #include Patrick Bellasi