Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp738591ybn; Wed, 2 Oct 2019 05:31:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqwytzAPXvHZMoMaBWLzekuoZFjRrhYXHOBvVXRo0CzkC/kpyG4QqX7wVJ1DxOYJOAJ53mkQ X-Received: by 2002:a50:ed8e:: with SMTP id h14mr3441504edr.69.1570019495286; Wed, 02 Oct 2019 05:31:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570019495; cv=none; d=google.com; s=arc-20160816; b=WnNXVrzR8aVo1VdprmHidBji4MMbmIvOLEV9o4otb6BKsxp+q8wKhYwxT7iWZmeKoB eoh/m/vRtR9wtjy5eNXP+aFVuCpL6OizIKPQkXzUZXWhicx09UKqp6XUSQz52PsMfiOK 5HYAtpWQvk6sTySHooVjFBfnGpM9AKFy0AwGfimnwCVWiIEL2E4hfNQLXlS+EHmH7nSi XwuKn4AK59Zl0KhZDf7CfGo8WL/V8/QbJFuWnWk/TEyUvJr9xzKg2m3GQ+Lus/VX5K3U kF8o6xzXQ4yBkHpT4x4oEO6x25Zxms/uJORTnZm5rWpm/er2pj7izgXxqJKAUOE5juMa GNLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=rr8caY35iJLVblzVMvkPcFUvkmMZxMuKOB+fXwvDHsE=; b=DV4wujgjGKtSTgFGr1kzRe0YnQTYsiw74EzSQ00dFact3bH0zcslgiIXLHZ/5ZsJQi vFi+ZSvghkstzdRVXxSfqJhv2AtZRNsNUI+qRCwm+ATOzREFXHzWKzF8m77HmpgcRNg1 t6NfpWzrFpJjcMQmglDYDXh/Sf5h0vLfEmvZL/Z7RGPTQVo8THQgsKwbJ18lTKw/alAp BXXyTiDjI1TXpA05R4Pmv2t/KshaF4E3phlcW83s0nx0RuUHgXxs4Zuldmn3smxRZY7G aykkO7GWEYJH7D6jZBnZADlyK4q1ELqAmG+zgzQIXBq3NV4tHMaOzbu9OJkyRcyD1DBD OCtg== 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 m33si11291134edc.94.2019.10.02.05.31.10; Wed, 02 Oct 2019 05:31:35 -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 S1727325AbfJBMYW (ORCPT + 99 others); Wed, 2 Oct 2019 08:24:22 -0400 Received: from mx2.suse.de ([195.135.220.15]:57254 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726635AbfJBMYT (ORCPT ); Wed, 2 Oct 2019 08:24:19 -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 91B0CACC3; Wed, 2 Oct 2019 12:24:17 +0000 (UTC) From: Giovanni Gherdovich To: Srinivas Pandruvada , Thomas Gleixner , Ingo Molnar , Peter Zijlstra , Borislav Petkov , Len Brown , "Rafael J . Wysocki" Cc: x86@kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Mel Gorman , Matt Fleming , Viresh Kumar , Juri Lelli , Paul Turner , Vincent Guittot , Quentin Perret , Dietmar Eggemann , Doug Smythies , Giovanni Gherdovich Subject: [PATCH v2 2/2] cpufreq: intel_pstate: Conditional frequency invariant accounting Date: Wed, 2 Oct 2019 14:29:26 +0200 Message-Id: <20191002122926.385-3-ggherdovich@suse.cz> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20191002122926.385-1-ggherdovich@suse.cz> References: <20191002122926.385-1-ggherdovich@suse.cz> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Srinivas Pandruvada 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 Signed-off-by: Giovanni Gherdovich --- 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 9f02de9a1b47..c7d9149e99ee 100644 --- a/drivers/cpufreq/intel_pstate.c +++ b/drivers/cpufreq/intel_pstate.c @@ -2493,6 +2493,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; @@ -2505,6 +2507,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(); + return 0; } -- 2.16.4