Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp5631039ybe; Tue, 17 Sep 2019 11:00:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqzYAWod5Fy4O7Ql2Xnwho6TOQQHX3y8Cmgofu2XZFoxAX1ZgA3AYqm9BCB3OYjcjur2+vFN X-Received: by 2002:a17:906:8054:: with SMTP id x20mr1059902ejw.65.1568743205078; Tue, 17 Sep 2019 11:00:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568743205; cv=none; d=google.com; s=arc-20160816; b=vDtVLb/jab30wdp+/PN64G9j6X1VNDHJ6VOu+QL9imM3H0m7q5CfYhq3h5diYP9gQY ennMNbki6GZS5mBUpn9uaSOBOBqhtZYYh1KfaQV3zZHBgbU4+jInAs/Y5Ftu7hKbS8fJ s+S6W7wUvMeARf6E0hU934s5OZ0MUixYdnXBnFCSqsffHBnJFQOErcENCDXxSMur9o7X a0TdUOPwkrA+WqyehNfk/tfx9mQHdrfgqyTyAtkmKm6HWhooYoxQiXU/RVPkz4pHid3H Fesj1bXuFf3bHPMOX1iegl2gyU7ticmbKaOqLOsM9qpiH+kQo8AMjGDKTrUh9zZL1yoo VBPw== 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:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id; bh=Tulh9uFV9f7MG7q8aSdu6fNbocAsMwihmJ0Xd8gHQNo=; b=ghDKtB7jJGXE0Hm76OYsy9HsouHUJj7IO/xOrmGjcg69xZSQv5oluJ14ym/+WxQlcB zqTdz4ZYsTvMydrIVCxgWqnLfuHulfMtAnxrGqR/dAn+SLYoyRv3Hq7wrEQN8vSeW1KY 36ElUBzBIoz8thtrVcWNOkomJtIHPNoitz8VbF8overmd3YIu+3lnE5NMSWCcOMiAWK5 wxVyqhwq1mCrUWYS+LcGDiad+tD0zYJgl8SXaEc0MpLCImKjMbfAyrZ/3yJkt1aFUA+x n1g1dLOZmcRdKrOzkD9anTV/0R4VoDLcv24gaXnsYszX93ldcc7FNx60zpD1Xj0xWDqq /DNQ== 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 m8si1484248eja.392.2019.09.17.10.59.41; Tue, 17 Sep 2019 11:00:05 -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 S1727707AbfIQOVp (ORCPT + 99 others); Tue, 17 Sep 2019 10:21:45 -0400 Received: from mx2.suse.de ([195.135.220.15]:50560 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725922AbfIQOVp (ORCPT ); Tue, 17 Sep 2019 10:21:45 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 544B3AF0D; Tue, 17 Sep 2019 14:21:43 +0000 (UTC) Message-ID: <1568730426.3329.3.camel@suse.cz> Subject: Re: [PATCH 1/2] x86,sched: Add support for frequency invariance From: Giovanni Gherdovich To: Srinivas Pandruvada , tglx@linutronix.de, mingo@redhat.com, peterz@infradead.org, bp@suse.de, lenb@kernel.org, rjw@rjwysocki.net Cc: x86@kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, mgorman@techsingularity.net, matt@codeblueprint.co.uk, viresh.kumar@linaro.org, juri.lelli@redhat.com, pjt@google.com, vincent.guittot@linaro.org, qperret@qperret.net, dietmar.eggemann@arm.com Date: Tue, 17 Sep 2019 16:27:06 +0200 In-Reply-To: <4226d5f460604a8130f8079b74ef3fb1d60009d7.camel@linux.intel.com> References: <20190909024216.5942-1-ggherdovich@suse.cz> <20190909024216.5942-2-ggherdovich@suse.cz> <4226d5f460604a8130f8079b74ef3fb1d60009d7.camel@linux.intel.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.26.6 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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). 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