From patchwork Sat Jun 24 05:11:54 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Len Brown X-Patchwork-Id: 9807591 X-Patchwork-Delegate: rjw@sisk.pl Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id ADCD3603F3 for ; Sat, 24 Jun 2017 05:12:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9C5C82854A for ; Sat, 24 Jun 2017 05:12:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 90C0F28558; Sat, 24 Jun 2017 05:12:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2E0142854A for ; Sat, 24 Jun 2017 05:12:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751316AbdFXFMh (ORCPT ); Sat, 24 Jun 2017 01:12:37 -0400 Received: from mail-qt0-f193.google.com ([209.85.216.193]:34258 "EHLO mail-qt0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750805AbdFXFME (ORCPT ); Sat, 24 Jun 2017 01:12:04 -0400 Received: by mail-qt0-f193.google.com with SMTP id w6so7637244qtg.1; Fri, 23 Jun 2017 22:12:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references:reply-to:organization; bh=vS/65CXVUvBJYzrWCFm3nmFzXQ2j7benFTPYJ0loJZA=; b=Om2o2khPCgQcrcwcN6qtNiwYTbBLusLsNR/UxYV3ZIaRJ3ivbDeaR5r0iueFRD/jjt Dg5NUgdcf2HKN8TYzP8DbNkKOQsQVhroPX9DVZQPy/iOQ+i1bafivUKd3E6Jt/oKCsAH EIWtSkXMY7Lwt/FHlSivRlhUcEoMhhSQnDLxGbBSNdsWUoL4EwvKOS+iIOlYlxDn1phF 1UUVQaxx6mM6bre1Max7cSgVhOA/NGsbIjncY+YNkogfP4MTVhj9VLDX1B+E+EeO/RMk 5ROHu2MZGvWq9SmNQY/4DtxuTnDAUHiuVG/MJeAaE9+11tI+fgEaSfIjymWsJzg0iJe2 oF1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:in-reply-to:references:reply-to:organization; bh=vS/65CXVUvBJYzrWCFm3nmFzXQ2j7benFTPYJ0loJZA=; b=Xbg69Vh+tsPpdygqyJSzx2h/KuX/TXi5rX89LU8976JEgfg3JV5J2zxaxq4sCP0NAd ysI9xdpjm80Wu1vdt63gLhrNkzGe/l947/FjUEsOOi9mmig7C59zY9LiwqhPjLUZC5Ob Tp2QAIE8o/tNi2sMmjEe/9E6BH6P2TK30W6xgJvE41xcbv8oAk9HpKi35TQc5qgJNVQF kF0No/EhjkdtSU4SIrJCol5WYn3fCRRaapf1ZPD1BtMHIrzEvKVG6B4K+yIPC3SYhgxh 5bmaJFyA1vfcM3tmBCp6z02uw1iOH11I4mij0fadIKEK5JIC97dJVeUXPtsaNdRPBVV7 BttQ== X-Gm-Message-State: AKS2vOwpeE2Ev9Imz6Wf04BW4EaKEfay12i4TsIyhVSdSrqjmKdh7wkK EbbEKfiQodBie0Bt X-Received: by 10.237.36.143 with SMTP id t15mr5288563qtc.180.1498281123659; Fri, 23 Jun 2017 22:12:03 -0700 (PDT) Received: from localhost.localdomain (pool-173-48-65-169.bstnma.fios.verizon.net. [173.48.65.169]) by smtp.gmail.com with ESMTPSA id k6sm5060704qtk.10.2017.06.23.22.12.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 23 Jun 2017 22:12:03 -0700 (PDT) From: Len Brown To: rafael@kernel.org, tglx@linutronix.de Cc: x86@kernel.org, srinivas.pandruvada@linux.intel.com, peterz@infradead.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Len Brown Subject: [PATCH 4/4] intel_pstate: skip scheduler hook when in "performance" mode. Date: Fri, 23 Jun 2017 22:11:54 -0700 Message-Id: <68516d288d3968fe22d6c8984a7bcbdcdbed351d.1498280509.git.len.brown@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1498281114-3868-1-git-send-email-lenb@kernel.org> References: <1498281114-3868-1-git-send-email-lenb@kernel.org> In-Reply-To: References: Reply-To: Len Brown Organization: Intel Open Source Technology Center Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Len Brown When the governor is set to "performance", intel_pstate does not need the scheduler hook for doing any calculations. Under these conditions, its only purpose is to continue to maintain cpufreq/scaling_cur_freq. The cpufreq/scaling_cur_freq sysfs attribute is now provided by shared x86 cpufreq code on modern x86 systems, including all systems supported by the intel_pstate driver. So in "performance" governor mode, the scheduler hook can be skipped. This applies to both in Software and Hardware P-state control modes. Suggested-by: Srinivas Pandruvada Signed-off-by: Len Brown --- drivers/cpufreq/intel_pstate.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c index 4ec5668..4538182 100644 --- a/drivers/cpufreq/intel_pstate.c +++ b/drivers/cpufreq/intel_pstate.c @@ -2031,10 +2031,10 @@ static int intel_pstate_set_policy(struct cpufreq_policy *policy) */ intel_pstate_clear_update_util_hook(policy->cpu); intel_pstate_max_within_limits(cpu); + } else { + intel_pstate_set_update_util_hook(policy->cpu); } - intel_pstate_set_update_util_hook(policy->cpu); - if (hwp_active) intel_pstate_hwp_set(policy->cpu);