Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp2173735imm; Wed, 16 May 2018 08:59:40 -0700 (PDT) X-Google-Smtp-Source: AB8JxZroLEQPcqI7lB1ZCS/lJIlSKW4S7vNdJRBdTG1cCujk4RCAKv8KWWkALWZWKTd9Xf4MSqTo X-Received: by 2002:a17:902:708a:: with SMTP id z10-v6mr1404185plk.283.1526486380491; Wed, 16 May 2018 08:59:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526486380; cv=none; d=google.com; s=arc-20160816; b=rHUMia8WYjsQcNDlfMz8WQ5RgadYheSZKMEf+sCX0uPrJjoQBWkkHPnXIJnc+l+RBf UWBXhXevikeSPNEzJAYMZtda9aBiFolDiKt6mIEONYZdwVDj4zurf2xf57pcfi9vbbN5 50DoNBddstECu+9OVErvG2Xaysblv+GEUWEKm2Vx915SAM2W+pTp/1kNz/5PMXZm/xFa 11vBvUHvMiF/9b5+KccWvwO0Ry9iB16CVSZr3u+BQajIZRBI1mSmpo+jtbTiPWBZJl7p S+kBmIVki9p3YlYpHwlyib84K77niW1OMQehGS9A7Y1roCpS61jS5a7zFTfDx+C7do1W 8ozg== 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 :arc-authentication-results; bh=mcx3pKM1aHf64dcfBr4f38DVVROrZFOL7jpiN3MJADI=; b=tcRXIUxftyOgw6331d1qJuvsnnlIzPkLDTmKawMKFeZEeetqhNMFkpYdb47i3/W0+G L5/ehzfTh7ORnCjNgnAiaR8ED5RdeL5qvSfwz04BMn8oNWPLu26blIRz7yOeB744P6WN u/feMDbQJuXWA/gsSyqQc+q5U81InXgOFIyeP69xKrSpYfQTPoJESzzSvO0pH3rnivBk Y0mZQPKFvZxYecCvgztCbZIbGyFJ6J42S61KXS2m593qD8cS47G8DuiHjFOMb9COfS7h mHe5u0TABFLC/TzLQ6Q5W820gpN++ZYZOc9wBcsID3o7rqIXpkBimfsONtERTVUtmQb7 O8uw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v16-v6si2849304pfn.77.2018.05.16.08.59.26; Wed, 16 May 2018 08:59:40 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751132AbeEPP6Y (ORCPT + 99 others); Wed, 16 May 2018 11:58:24 -0400 Received: from mga17.intel.com ([192.55.52.151]:42691 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750746AbeEPP6X (ORCPT ); Wed, 16 May 2018 11:58:23 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 May 2018 08:58:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,406,1520924400"; d="scan'208";a="41443907" Received: from spandruv-desk.jf.intel.com ([10.54.75.31]) by orsmga007.jf.intel.com with ESMTP; 16 May 2018 08:58:22 -0700 Message-ID: <1526486302.61700.23.camel@linux.intel.com> Subject: Re: [RFC/RFT] [PATCH 02/10] cpufreq: intel_pstate: Conditional frequency invariant accounting From: Srinivas Pandruvada To: Juri Lelli Cc: tglx@linutronix.de, mingo@redhat.com, peterz@infradead.org, bp@suse.de, lenb@kernel.org, rjw@rjwysocki.net, mgorman@techsingularity.net, x86@kernel.org, linux-pm@vger.kernel.org, viresh.kumar@linaro.org, linux-kernel@vger.kernel.org Date: Wed, 16 May 2018 08:58:22 -0700 In-Reply-To: <20180516151925.GO28366@localhost.localdomain> References: <20180516044911.28797-1-srinivas.pandruvada@linux.intel.com> <20180516044911.28797-3-srinivas.pandruvada@linux.intel.com> <20180516151925.GO28366@localhost.localdomain> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.24.6 (3.24.6-1.fc26) 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 On Wed, 2018-05-16 at 17:19 +0200, Juri Lelli wrote: > On 15/05/18 21:49, Srinivas Pandruvada wrote: > > intel_pstate has two operating modes: active and passive. In > > "active" > > mode, the in-built scaling governor is used and in "passive" mode, > > the driver can be used with any governor like "schedutil". In > > "active" > > mode the utilization values from schedutil is not used and there is > > a requirement from high performance computing use cases, not to > > read > > any APERF/MPERF MSRs. In this case no need to use CPU cycles for > > frequency invariant accounting by reading APERF/MPERF MSRs. > > With this change frequency invariant account is only enabled in > > "passive" mode. > > > > Signed-off-by: Srinivas Pandruvada > .com> > > --- > > [Note: The tick will be enabled later in the series when hwp > > dynamic > > boost is enabled] > > > > drivers/cpufreq/intel_pstate.c | 5 +++++ > > 1 file changed, 5 insertions(+) > > > > diff --git a/drivers/cpufreq/intel_pstate.c > > b/drivers/cpufreq/intel_pstate.c > > index 17e566af..f686bbe 100644 > > --- a/drivers/cpufreq/intel_pstate.c > > +++ b/drivers/cpufreq/intel_pstate.c > > @@ -2040,6 +2040,8 @@ static int > > intel_pstate_register_driver(struct cpufreq_driver *driver) > > { > > int ret; > > > > + x86_arch_scale_freq_tick_disable(); > > + > > memset(&global, 0, sizeof(global)); > > global.max_perf_pct = 100; > > > > @@ -2052,6 +2054,9 @@ static int > > intel_pstate_register_driver(struct cpufreq_driver *driver) > > > > global.min_perf_pct = min_perf_pct_min(); > > > > + if (driver == &intel_cpufreq) > > + x86_arch_scale_freq_tick_enable(); > > This will unconditionally trigger the reading/calculation at each > tick > even though information is not actually consumed (e.g., running > performance or any other governor), right? Do we want that? Good point. I should call x86_arch_scale_freq_tick_disable() in performance mode switch for active mode. Thanks, Srinivas > > Anyway, FWIW I started testing this on a E5-2609 v3 and I'm not > seeing > hackbench regressions so far (running with schedutil governor). > > Best, > > - Juri