Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp3199445ybc; Thu, 21 Nov 2019 04:58:48 -0800 (PST) X-Google-Smtp-Source: APXvYqwbBacRPeIb5gu20HwKkXUuZ9gFLS/Z4VM8hBTLKH03T80eOT6jko0HPns3syHrHFmzl22R X-Received: by 2002:a17:906:4e0e:: with SMTP id z14mr13422723eju.173.1574341128200; Thu, 21 Nov 2019 04:58:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574341128; cv=none; d=google.com; s=arc-20160816; b=ukKlPz7IS0IU+ROb6D7fpEWbVrsyvFC14I0GtGD6v4rghlsbOsLobX7FpMSdNmTG8D 9KBMhGLxyNrvI021h061WKnRfptdrU3KngY963cQhMIOChn3FEXDSo7k7VDMVfatW5My yppATNr0YtQbcVj42t9153/AZJ9UST0AyMjEXsJFRVc2GMnICeF5qokWiDcurTxhuljI yGC924L2+ulxSxcfiGqyfUj69E1XTyQANbC+5EQotmldL97YZqIvQr1Ulir7lr7BGg2I r/y/EVYyFW46zNbQ7aqL5rWivnUDr+yghuCiNLv90IHRBahUNVItrDTcNMIzvU0ftaW6 5ulA== 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:user-agent:date :message-id:from:references:cc:to:subject; bh=AYcLFDRD88/UClpIHw9lcZbJBioUfxVs1KhM4A+i9HU=; b=pHItWazqhJX/6S2coZl5ZqI4TkurE7RqLxWlicR9o8LR0qVAg8V1dRlEtu12JdzRJK 8eEnnFsmuThaSNFpyEhWUCryFnD7AlAwA0ZP0oG+iJ8+NiSgW+a8jFHAg4ABsnw8IoxB TT/qWLdqgutUfr+z6Bs2Jbu7LabUI345xkoycOxFzQE221clc7059dpVKSJK/k3Z1p// Rp761HARUUvYTgL1+mqAIT13eTcCl4Daemjyi54QL1sEX+IfS+CW86rlEcvruSMZulq3 193UONg4EoZ5+Q4zrUietfgdotT2RgtxUuyIQI9jCDv0UNjbK64TE/1MlfOgTMhhlQuD cA5A== 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 g40si2173118edb.369.2019.11.21.04.58.23; Thu, 21 Nov 2019 04:58:48 -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 S1726638AbfKUM4u (ORCPT + 99 others); Thu, 21 Nov 2019 07:56:50 -0500 Received: from foss.arm.com ([217.140.110.172]:55778 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726293AbfKUM4u (ORCPT ); Thu, 21 Nov 2019 07:56:50 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 5D365DA7; Thu, 21 Nov 2019 04:56:49 -0800 (PST) Received: from [10.0.2.15] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 023513F703; Thu, 21 Nov 2019 04:56:47 -0800 (PST) Subject: Re: [PATCH 3/3] sched/fair: Consider uclamp for "task fits capacity" checks To: Quentin Perret Cc: linux-kernel@vger.kernel.org, peterz@infradead.org, mingo@kernel.org, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, patrick.bellasi@matbug.net, qais.yousef@arm.com, morten.rasmussen@arm.com References: <20191120175533.4672-1-valentin.schneider@arm.com> <20191120175533.4672-4-valentin.schneider@arm.com> <20191121115602.GA213296@google.com> From: Valentin Schneider Message-ID: Date: Thu, 21 Nov 2019 12:56:39 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <20191121115602.GA213296@google.com> Content-Type: text/plain; charset=utf-8 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 21/11/2019 11:56, Quentin Perret wrote: > On Wednesday 20 Nov 2019 at 17:55:33 (+0000), Valentin Schneider wrote: >> +static inline >> +unsigned long uclamp_task_util(struct task_struct *p, unsigned long util) > > This 'util' parameter is always task_util_est(p) right ? You might want > to remove it. > I went with copying uclamp_rq_util()'s API, but you're right in that I don't see what other value (than util_est) would make sense for this helper. If there is no objections I'll kill the parameter for v2. >> +{ >> + return clamp(util, >> + (unsigned long)uclamp_eff_value(p, UCLAMP_MIN), >> + (unsigned long)uclamp_eff_value(p, UCLAMP_MAX)); >> +} > > Thanks, > Quentin > Another thing I realized overnight; tell me what you think: > @@ -6274,6 +6274,15 @@ static int find_energy_efficient_cpu(struct task_struct *p, int prev_cpu) > if (!fits_capacity(util, cpu_cap)) > continue; > > + /* > + * Skip CPUs that don't satisfy uclamp requests. Note > + * that the above already ensures the CPU has enough > + * spare capacity for the task; this is only really for > + * uclamp restrictions. > + */ > + if (!task_fits_capacity(p, capacity_orig_of(cpu))) > + continue; This is partly redundant with the above, I think. What we really want here is just fits_capacity(uclamp_eff_value(p, UCLAMP_MIN), capacity_orig_of(cpu)) but this would require some inline #ifdeffery. > + > /* Always use prev_cpu as a candidate. */ > if (cpu == prev_cpu) { > prev_delta = compute_energy(p, prev_cpu, pd);