Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp837000imu; Wed, 23 Jan 2019 06:35:06 -0800 (PST) X-Google-Smtp-Source: ALg8bN4yEITpLloasU/p0CocmfVFbrSNShB6DnfXhpOw3Rs53HgcpEEmyfGQHeCDf3BuYA02qY3x X-Received: by 2002:a17:902:4124:: with SMTP id e33mr2427997pld.236.1548254106823; Wed, 23 Jan 2019 06:35:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548254106; cv=none; d=google.com; s=arc-20160816; b=vX2RN7xBw2lulMWDBozkIAbnnaurv+CvlNkrbQGOurNtn7fT9Ogw0AuBrpPhKuZMHc gtRZtCgCNCk+I9lD/1CNWd/Cy4OVtJik+I6m6VNzH2JidUfu1BUEdCl7DJ7jICsj1VjI IIkIjJaEOIgDM0M9dIkatw70woc3zWnU0v1XIqUNu4jFBSVoUi8vwn8Tt5Y7MkIn+sXX gR1txx60Xj84A5VRanjBd9iccPSTMYOTH+BjDs3hPr5p129dbBPvKe0FHFecYZQ0EG3Q PHXZrHgk05oZjiV5YNLXrfyBOhZQHSwzcNxfhUmoN2f46DC65lTxC5+nH+N9q7nEGvAm 0AtQ== 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; bh=jglCvezxAm4hgT+E5R5jp0DS92VTYUnotm/bukP3YQc=; b=Y/pWAjsnkXYV4VK9H7/7oJ9XT7bb3Gn1YmTJXmGG1waelF1z155PEfVGukujp4QWAY JjRXiGNnk06hTEb/VGxczTsK1G2BIbByAXPErfWGiqkrVjshZ8wJmJSnEUFrVauLGQ5V qxRHbYmROUHJQeyrWsLDNabqqKC+mbugJ2qkiwIzPJe75VyKpLYoWv5kjp+rikkM8kQf uxgd1PpjdaV904FdGJcJjA62z99P4tgZ05SughC4cWhjJ08rAyaQTHRxP6gsmsXt+E5/ ELGOczFeR6ttKEHDx6brsMZHAEBtC6W7UNa24lXZlRNxZwfi4K/pzw6NwH1z2EqS4tVu Pz4g== 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 g124si18847860pgc.568.2019.01.23.06.34.50; Wed, 23 Jan 2019 06:35:06 -0800 (PST) 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 S1727143AbfAWOdd (ORCPT + 99 others); Wed, 23 Jan 2019 09:33:33 -0500 Received: from foss.arm.com ([217.140.101.70]:42070 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726823AbfAWOdd (ORCPT ); Wed, 23 Jan 2019 09:33:33 -0500 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 B9180A78; Wed, 23 Jan 2019 06:33:32 -0800 (PST) Received: from e110439-lin (e110439-lin.cambridge.arm.com [10.1.194.43]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id C250A3F237; Wed, 23 Jan 2019 06:33:29 -0800 (PST) Date: Wed, 23 Jan 2019 14:33:27 +0000 From: Patrick Bellasi To: Peter Zijlstra Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, linux-api@vger.kernel.org, Ingo Molnar , Tejun Heo , "Rafael J . Wysocki" , Vincent Guittot , Viresh Kumar , Paul Turner , Quentin Perret , Dietmar Eggemann , Morten Rasmussen , Juri Lelli , Todd Kjos , Joel Fernandes , Steve Muckle , Suren Baghdasaryan Subject: Re: [PATCH v6 09/16] sched/cpufreq: uclamp: Add utilization clamping for RT tasks Message-ID: <20190123143327.whlyx2223xzchbkl@e110439-lin> References: <20190115101513.2822-1-patrick.bellasi@arm.com> <20190115101513.2822-10-patrick.bellasi@arm.com> <20190123102821.GW27931@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190123102821.GW27931@hirez.programming.kicks-ass.net> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 23-Jan 11:28, Peter Zijlstra wrote: > On Tue, Jan 15, 2019 at 10:15:06AM +0000, Patrick Bellasi wrote: > > - util = (type == ENERGY_UTIL) > > - ? util_cfs > > - : uclamp_util(rq, util_cfs); > > - util += cpu_util_rt(rq); > > + util = cpu_util_rt(rq); > > + if (type == FREQUENCY_UTIL) { > > + util += cpu_util_cfs(rq); > > + util = uclamp_util(rq, util); > > + } else { > > + util += util_cfs; > > + } > > Or the combined thing: > > - util = util_cfs; > - util += cpu_util_rt(rq); > + util = cpu_util_rt(rq); > + if (type == FREQUENCY_UTIL) { > + util += cpu_util_cfs(rq); > + util = uclamp_util(rq, util); > + } else { > + util += util_cfs; > + } > > > Leaves me confused. > > When type == FREQ, util_cfs should already be cpu_util_cfs(), per > sugov_get_util(). > > So should that not end up like: > > util = util_cfs; > util += cpu_util_rt(rq); > + if (type == FREQUENCY_UTIL) > + util = uclamp_util(rq, util); > > instead? You right, I get to that core after the patches which integrate compute_energy(). The chuck above was the version before the EM got merged but I missed to backport the change once I rebased on tip/sched/core with the EM in. Sorry for the confusion, will fix in v7. Cheers -- #include Patrick Bellasi