From patchwork Thu Jun 8 02:39:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Len Brown X-Patchwork-Id: 9773773 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 3F04460350 for ; Thu, 8 Jun 2017 02:40:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2EC86251F4 for ; Thu, 8 Jun 2017 02:40:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 238B02847A; Thu, 8 Jun 2017 02:40:24 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,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 A85C72854A for ; Thu, 8 Jun 2017 02:40:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751481AbdFHCj4 (ORCPT ); Wed, 7 Jun 2017 22:39:56 -0400 Received: from mail-qt0-f194.google.com ([209.85.216.194]:36515 "EHLO mail-qt0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752017AbdFHCj2 (ORCPT ); Wed, 7 Jun 2017 22:39:28 -0400 Received: by mail-qt0-f194.google.com with SMTP id s33so5423025qtg.3; Wed, 07 Jun 2017 19:39:27 -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=6XZ01BeQdXbpwm4jWVZu8e1tIz5Ul13ccvBoRkgB3i0=; b=kYMf/DsEq/Nzui/5FXWHBlvwtW8GqxQbZJ0Zbw2vMo1lPBocK2k9ZrXkfPnN7TvJrV /jVOVTqnyCnM6bg9WhPDHHBDspXeVN98DLkFHpPbNFCaWQMy0NsajwNzGEropQ8eyLn6 /Yhdmkv7f8aE/tfr4+jkMxsxVZjY2HAB6VxjRQbxo7hfO0Q4rjwZ3nIKE3rZPYpkJJp2 xHU8jTp29vLCz2RomUqS/dcEOzO/4rhEf7loDRkC6VZg6Sza04aK6fq886CgNQnum/4n 33zxjnHhLHfpemGHy5RM+FPBB6Gf0x7GBQIRnRzp4YYPrI+WZ26YOz89jzuAUMH4szml 94/Q== 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=6XZ01BeQdXbpwm4jWVZu8e1tIz5Ul13ccvBoRkgB3i0=; b=cfFKuO0TKrWHe7JSBSB4461XmYgu00pszvTy8Own1ZdMSHkvmE1PL3i3SvZ5EhHEvD /fSHnfySeRLjdvREiaMOzBQPDW8ma8qc+8fvIE1QRNm5mQdF4ugStd8cGJcGSlGmHhTl j4Qyv0ybjQVR/C6v6oZyvu+YjH5qyH41PHZVbtXFKUcfhbgqRaNhIN58rMUBZz0CUCNz RvCA9HvUlkSHFD03/E4gjNjJcPpFfzBtZhVgXs4W8emmOd8YxM1RsdVEDE64nPoblUdI fGTrsmlBGeibsGpguZF9RHJua538xJUPuq/n+tUEzcXtxEhzS3XZ0g32lZtSq47svR2H esZg== X-Gm-Message-State: AKS2vOwHO45MYL5e5i8WmtBxGerbO61lk/j8nOYLOUtu1VZRlbduJQMB c+8Fdboi1ez1cQ== X-Received: by 10.55.204.19 with SMTP id r19mr21570198qki.88.1496889567092; Wed, 07 Jun 2017 19:39:27 -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 b69sm2565506qkb.51.2017.06.07.19.39.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 07 Jun 2017 19:39:26 -0700 (PDT) From: Len Brown To: x86@kernel.org, srinivas.pandruvada@linux.intel.com, hpa@linux.intel.com, peterz@infradead.org, rafael@kernel.org Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Len Brown Subject: [PATCH 4/5] intel_pstate: skip scheduler hook when in "performance" mode. Date: Wed, 7 Jun 2017 19:39:15 -0700 Message-Id: <1ecfadf4193fbd8873d4bcda9e9faec5825bcafb.1496889051.git.len.brown@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1496889556-17923-1-git-send-email-lenb@kernel.org> References: <1496889556-17923-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. But the cpufreq/scaling_cur_freq sysfs attribute is now provided by the x86 cpufreq core on all 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 5d67780..0ff3a4b 100644 --- a/drivers/cpufreq/intel_pstate.c +++ b/drivers/cpufreq/intel_pstate.c @@ -2025,10 +2025,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);