Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp3486470ybi; Tue, 18 Jun 2019 01:23:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqxn9YaV3LIczbovedHhZEx1k8kIDgqFoY9IJni8SWpZPL1JPDkrOCnd6VkhpuCZTCsHAUgq X-Received: by 2002:aa7:9825:: with SMTP id q5mr3365332pfl.140.1560846218375; Tue, 18 Jun 2019 01:23:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560846218; cv=none; d=google.com; s=arc-20160816; b=cwBqAOTbx7eG6FqyIUx0l8YibCzCGphnSj7pcM+xdAkFT3nTyWXn99vLIcYPQuTBjs 3tZZUEBYrjDrZVbrMI6eIjiOkp1w9F2Sr0Ou04qMQpgwRgG99ChXoIcJX80zteBX6pwH Pvhe6M8q8OARqTNcfn2uSBVYidPhgmhhJUJFHOR+tRZYXTR1c4/obVofbqB1btGYl0ek wwaIkSG0MVdqGvEkaHDrRpPag4J6GVAtUNbfJK5F/YkpqWAGkOM+xXcU+DLPOwfTDXsP lJmRMDAthn6ywaJPS3kJcTrKqozf/7lSN9KaC3t7vFvwcKxniLsKrvOl5Bh5J+ui6BHi UJkg== 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=7Cp1Ui+BZMwXynGflrOuwPEWCkHsXWzyE57K9puY4j8=; b=jEOVgAq2zZwTmRBOzbUEmVo2jL5fAb5tCYCVKem3HCxgD9faFwGuabrGXi/C0LDMN8 rubduL8kyTUdeSBNB9lqXgsR5VBtiRVACQfvjPmdk72UJxFHQaH0LfWpj3JHYd3qy+qP VorEgF3V4Ivo4Z1dkEuNegsGhAh9eVWGbHbYEHeXQJ5DTf2iMxI/z5IlgqwJV+XK7Q9I 0nEDJqrs2WZ0/7ZKiGOUlfsExZq2G/rzb7XCCuRMLp4aZGXP3sTmfmAB/nZTgmwQns7U llcevZQNUV2LwvdOPy8MNSWCmrbN9Mw5Igr34420fSwp2cSkoLs3FIERWxHPmCYRdaPd 3kOg== 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 a14si13193037pfo.37.2019.06.18.01.23.22; Tue, 18 Jun 2019 01:23:38 -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 S1729061AbfFRIWT (ORCPT + 99 others); Tue, 18 Jun 2019 04:22:19 -0400 Received: from foss.arm.com ([217.140.110.172]:56578 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725913AbfFRIWS (ORCPT ); Tue, 18 Jun 2019 04:22:18 -0400 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 0AF2928; Tue, 18 Jun 2019 01:22:18 -0700 (PDT) Received: from queper01-lin (queper01-lin.cambridge.arm.com [10.1.195.48]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 226CB3F246; Tue, 18 Jun 2019 01:22:17 -0700 (PDT) Date: Tue, 18 Jun 2019 09:22:12 +0100 From: Quentin Perret To: Viresh Kumar Cc: "Rafael J. Wysocki" , Peter Zijlstra , Ingo Molnar , Linux Kernel Mailing List , Vincent Guittot Subject: Re: [PATCH] sched/fair: Introduce fits_capacity() Message-ID: <20190618082209.xshfus2t626o2dgb@queper01-lin> References: <20190605091644.w3g7hc7r3eiscz4f@queper01-lin> <20190606025204.qe5v7j6fysjkgxc6@vireshk-i7> <20190617150204.GG3436@hirez.programming.kicks-ass.net> <20190618031217.63md32da5pzydqia@vireshk-i7> <20190618074728.gf6wugkbndhhcqql@vireshk-i7> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190618074728.gf6wugkbndhhcqql@vireshk-i7> User-Agent: NeoMutt/20171215 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tuesday 18 Jun 2019 at 13:17:28 (+0530), Viresh Kumar wrote: > On 18-06-19, 09:26, Rafael J. Wysocki wrote: > > On Tue, Jun 18, 2019 at 5:12 AM Viresh Kumar wrote: > > > > > > +Rafael > > > > > > On 17-06-19, 17:02, Peter Zijlstra wrote: > > > > On Thu, Jun 06, 2019 at 08:22:04AM +0530, Viresh Kumar wrote: > > > > > Hmm, even if the values are same currently I am not sure if we want > > > > > the same for ever. I will write a patch for it though, if Peter/Rafael > > > > > feel the same as you. > > > > > > > > Is it really the same variable or just two numbers that happen to be the > > > > same? > > > > > > In both cases we are trying to keep the load under 80% of what can be supported. > > > But I am not sure of the answer to your question. > > > > > > Maybe Rafael knows :) > > > > Which variable? > > Schedutil multiplies the target frequency by 1.25 (20% more capacity eventually) > to get enough room for more load and similar thing is done in fair.c at several > places to see if the new task can fit in a runqueue without overloading it. > > Quentin suggested to use common code for this calculation and that is what is > getting discussed here. Right, sugov and load balance happen to use the same margin (1.25) to check if a given util fits in a given capacity, though the thresholds are hardcoded in different places (see map_util_freq() and capacity_margin). So my suggestion was to unify the capacity_margin code for frequency selection and CPU selection, for clarity and consistency. But again, this is a small thing and FWIW Viresh's patch LGTM as-is so no objection from my end if you guys would like to merge it. Thanks, Quentin