Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp5665490ybe; Tue, 17 Sep 2019 11:31:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqxdmMOpSdn4aOLYa8/chkqS2z3aQnb3+am67FcFjsvddKUklaiTMq1mxf6Yd2K63o5srsPN X-Received: by 2002:aa7:c80e:: with SMTP id a14mr6171383edt.205.1568745106127; Tue, 17 Sep 2019 11:31:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568745106; cv=none; d=google.com; s=arc-20160816; b=JdSnBIsRxNpONnPLY14/dSHDVGIeV/N/nr01Ukm7LrJYYl0FV4wkRRQKdlcWzbxu0I seb6Pj94AccKUc217poFLK8VIoID19ZS2jNpOi/FcO0AyknfH7/h3N1eU0cKvlOI77NU QH7vwUqR7s/Xm0l0qrrp45d2CMpMFnrNVpm86VLmPmpew+1oIMe5cVHvEuBUaPeYuExT oDOn1yIQt0JilLddDH0m7YDGTQGSfxp+iJYYBfmnwe/khWd317NssTxorvHc8Uh4pS8H pTXj+iH/VZu3r1Otccui+vr2nvgWccw8MtDywIzO9yHsKJGhGXq8knyo2S9d6vhT7CT6 BCjQ== 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=IaYBjBB2ciR2FZbasZb6pweK9GCwJkoOMmn4LHV+BHQ=; b=f0Vexd4ASHXODhiFBAFgjz1+9ySHQLfR3FpvMS1k2QRCV5SXC+MfDQi2Wy9MNEehab txmw6bGZVHyMSeH6bVlz9vpMztgiGrhaAyqVerpaK5pdAZnZdV3VAJQJXF+Gl6LdgHxf fT69Ej88BIcP7Bu+cyebRo96AT6Q809GYUQwr0IfFWwoeQ4dtmv1nXDgOLttDr9ic+BW BM9qugQJKhOrA3m4FO6SpUc5VqKRwzurcIRjaRRLtdb5vIpFFvISMilYAymh9gsWq5fJ XuQCn2WV20W0H/o8e85O6gbi+c44/bebriSJeOb3AXZHvsXzCX5E9K6LdoYlCAyGFMQF b47A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LWAM28RJ; 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 gg17si1038219ejb.294.2019.09.17.11.31.21; Tue, 17 Sep 2019 11:31:46 -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=LWAM28RJ; 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 S1730209AbfIQP4O (ORCPT + 99 others); Tue, 17 Sep 2019 11:56:14 -0400 Received: from mail-lf1-f65.google.com ([209.85.167.65]:37571 "EHLO mail-lf1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730107AbfIQPzo (ORCPT ); Tue, 17 Sep 2019 11:55:44 -0400 Received: by mail-lf1-f65.google.com with SMTP id w67so3322927lff.4 for ; Tue, 17 Sep 2019 08:55:43 -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=IaYBjBB2ciR2FZbasZb6pweK9GCwJkoOMmn4LHV+BHQ=; b=LWAM28RJdpsodjhvi9CY2qESRcdr9tSPL6P3lrcUVSuIeDJ2fOTBvd42az3X0wqS4f xFUoxTyUjfcVx0AlrPJ25NGRr5jtU+7Db/ymeP4WHLUosTGAykZY2IGKEtA9EG+e7/6H hMBTdO1/WocsA3vnU31M55/2AlKK+dZVyWprCxBks2YDTZZ4OtLJw+zEAbp+Y2v/1C5z onvtCwzlUYtQs2yzh54yoPmUFarfEZ78zNgDKQl2AOO39cGvemeDZEuB6I5koiTEsMY0 gTPjBHF+LRRu+xcKmsW2WFfkZttcGMdYqKweHOt4j16mbRYn3XrWB86glKBTiYUunDZJ MCNg== 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=IaYBjBB2ciR2FZbasZb6pweK9GCwJkoOMmn4LHV+BHQ=; b=chwf0HFJiP/eMWVPicBn8Yyx7xDfWZTV3kJvkCe5v6jnQUEzbQIhSDPeaE4rTlLagd DsNF7YsHA54L5KzZdxMhfoTzIE900mH0fnKg5pTBnebQkWBz/6+gNSQHnhe10Os2H7rR 5dG9rRx2I76N7Zlgoy0tCJ5ja6Rf5Gj9hokdCPqMnvem94n7n1w9hAng8webftsEFcCu tMGYG8sCEIZfJKk+BwFTN80ymRTEYqr1LLtwJRN0dBkRzXvixTdY1qzCywijH4+Jg3hP 3X4gVId4X957urSH8/r1+omb7pa1t+K9NOlB6ctG38og+rSBrhJUmxTz6Mei1URSe0i9 AlOQ== X-Gm-Message-State: APjAAAUl9pLdY/rzTMKP7ilOPr1HF5btL5K+KSfLRkv2Z/6yqAxHshbE J5fmLHT142OZKbW07d+WCzj9BTygb01+xSJQHcFP7w== X-Received: by 2002:ac2:5203:: with SMTP id a3mr2437460lfl.151.1568735742321; Tue, 17 Sep 2019 08:55:42 -0700 (PDT) MIME-Version: 1.0 References: <20190909024216.5942-1-ggherdovich@suse.cz> <20190909024216.5942-2-ggherdovich@suse.cz> <4226d5f460604a8130f8079b74ef3fb1d60009d7.camel@linux.intel.com> <1568730426.3329.3.camel@suse.cz> In-Reply-To: <1568730426.3329.3.camel@suse.cz> From: Vincent Guittot Date: Tue, 17 Sep 2019 17:55:29 +0200 Message-ID: Subject: Re: [PATCH 1/2] x86,sched: Add support for frequency invariance To: Giovanni Gherdovich Cc: Srinivas Pandruvada , Thomas Gleixner , Ingo Molnar , Peter Zijlstra , bp@suse.de, "Cc: Len Brown" , "Rafael J. Wysocki" , x86@kernel.org, "open list:THERMAL" , linux-kernel , Mel Gorman , Matt Fleming , viresh kumar , Juri Lelli , Paul Turner , qperret@qperret.net, Dietmar Eggemann 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 Tue, 17 Sep 2019 at 16:21, Giovanni Gherdovich wrote: > > Hello Srinivas, > > On Fri, 2019-09-13 at 15:52 -0700, Srinivas Pandruvada wrote: > > On Mon, 2019-09-09 at 04:42 +0200, Giovanni Gherdovich wrote: > > > > ... > > > > > + > > > +/* > > > + * APERF/MPERF frequency ratio computation. > > > + * > > > + * The scheduler wants to do frequency invariant accounting and > > > needs a <1 > > > + * ratio to account for the 'current' frequency, corresponding to > > > + * freq_curr / freq_max. > > > > I thought this is no longer the restriction and Vincent did some work > > to remove this restriction. > > If you're referring to the patch > > 23127296889f "sched/fair: Update scale invariance of PELT" > > merged in v5.2, I'm familiar with that and from my understanding you still > want a <1 scaling factor. This is my recalling of the patch: > > Vincent was studying some synthetic traces and realized that util_avg reported > by PELT didn't quite match the result you'd get computing the formula with pen > and paper (theoretical value). To address this he changed where the scaling > factor is applied in the PELT formula. > > At some point when accumulating the PELT sums, you'll have to measure the time > 'delta' since you last updated PELT. What we have after Vincent's change is > that this time length 'delta' gets itself scaled by the freq_curr/freq_max > ratio: > > delta = time since last PELT update > delta *= freq_percent > > In this way time goes at "wall clock speed" only when you're running at max > capacitiy, and goes "slower" (from the PELT point of view) if we're running at > a lower frequency. I don't think Vincent had in mind a faster-than-wall-clock > PELT time (which you'd get w/ freq_percent>1). Yes, I haven't really planned to have time going faster that wall clock but I don't see any algorithm problem at least if that would be the case. There will be a reduced maximum delta update of clock pelt but that will still be large enough > > Speaking of which, Srinivas, do you have any opinion and/or requirement about > this? I confusely remember Peter Zijlstra saying (more than a year ago, now) > that you would like an unclipped freq_curr/freq_max ratio, and may not be > happy with this patch clipping it to 1 when freq_curr > 4_cores_turbo. If > that's the case, could you elaborate on this? > Ignore that if it doesn't make sense, I may be mis-remembering. > > > Thanks, > Giovanni