From patchwork Thu Jul 18 15:48:42 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: dirk.brandewie@gmail.com X-Patchwork-Id: 2829693 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 6E8DF9F967 for ; Thu, 18 Jul 2013 15:49:31 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B19962018C for ; Thu, 18 Jul 2013 15:49:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 65F43201BD for ; Thu, 18 Jul 2013 15:49:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759091Ab3GRPtX (ORCPT ); Thu, 18 Jul 2013 11:49:23 -0400 Received: from mail-pa0-f50.google.com ([209.85.220.50]:50074 "EHLO mail-pa0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759086Ab3GRPtW (ORCPT ); Thu, 18 Jul 2013 11:49:22 -0400 Received: by mail-pa0-f50.google.com with SMTP id fb1so3382844pad.9 for ; Thu, 18 Jul 2013 08:49:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer; bh=UbQn+ItRCqhgQk1BYt0QuJSn8XaNofIICkPZiEaZx68=; b=JeEPOKC50dscajwPfYQVvHGUKU1ixw3hqw0ErWkWKVvz+mprRJ7K56GuT18KMlYIsU sFsVJ+HFFgbcCDX2eLG8A4PaQdenlkIMxVSD6NQNLWJpZDnDb5b0yOhJERZNCG5jkClf XbuHP/KuuuagxB2w6+hhttHX+HhLFpvipeYZZdDJXkdYgiYVqvtcaq4T+2e2YDxTVWpk hpDbLemRrR5yloZnka0E2ZHNDKTnmmYSarsUaqxBiHe3+LvmlBOO0Y087rKGNKObIznA e9YLbyp1YDf560wvI0cHU+sxfzYQrEQcvpRGmxbINlgtDZT7stl+Oh0wPSnYPrxHX9my Dr6A== X-Received: by 10.66.162.135 with SMTP id ya7mr13582556pab.173.1374162561554; Thu, 18 Jul 2013 08:49:21 -0700 (PDT) Received: from echolake.localdomain (static-50-43-43-195.bvtn.or.frontiernet.net. [50.43.43.195]) by mx.google.com with ESMTPSA id ue9sm17443191pab.7.2013.07.18.08.49.19 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 18 Jul 2013 08:49:20 -0700 (PDT) From: dirk.brandewie@gmail.com To: kernel@vger.kernel.org, linux-pm@vger.kernel.org Cc: dirk.brandewie@gmail.com, Dirk Brandewie , stable@vger.kernel.org, dsmythies@telus.net Subject: [PATCH] cpufreq/intel_pstate: Change to scale off of max P-state Date: Thu, 18 Jul 2013 08:48:42 -0700 Message-Id: <1374162523-2777-1-git-send-email-dirk.j.brandewie@gmail.com> X-Mailer: git-send-email 1.8.3.1 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Dirk Brandewie Change to using max P-state instead of max turbo P-state. This change resolves two issues. On a quiet system intel_pstate can fail to respond to a load change. https://bugzilla.kernel.org/show_bug.cgi?id=59481 On CPU SKUs that have a limited number of P-states and no turbo range intel_pstate fails to select the highest available P-state. This change is suitable for stable v3.9+ Reported-by: arjan@linux.intel.com Reported-by: dsmythies@telus.net Tested-by: arjan@linux.intel.com Tested-by: dsmythies@telus.net CC: stable@vger.kernel.org CC: dsmythies@telus.net Signed-off-by: Dirk Brandewie Acked-by: Viresh Kumar --- drivers/cpufreq/intel_pstate.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c index 07f2840..6d6a0b4 100644 --- a/drivers/cpufreq/intel_pstate.c +++ b/drivers/cpufreq/intel_pstate.c @@ -103,10 +103,10 @@ struct pstate_adjust_policy { static struct pstate_adjust_policy default_policy = { .sample_rate_ms = 10, .deadband = 0, - .setpoint = 109, - .p_gain_pct = 17, + .setpoint = 97, + .p_gain_pct = 20, .d_gain_pct = 0, - .i_gain_pct = 4, + .i_gain_pct = 0, }; struct perf_limits { @@ -468,12 +468,12 @@ static inline void intel_pstate_set_sample_time(struct cpudata *cpu) static inline int intel_pstate_get_scaled_busy(struct cpudata *cpu) { int32_t busy_scaled; - int32_t core_busy, turbo_pstate, current_pstate; + int32_t core_busy, max_pstate, current_pstate; core_busy = int_tofp(cpu->samples[cpu->sample_ptr].core_pct_busy); - turbo_pstate = int_tofp(cpu->pstate.turbo_pstate); + max_pstate = int_tofp(cpu->pstate.max_pstate); current_pstate = int_tofp(cpu->pstate.current_pstate); - busy_scaled = mul_fp(core_busy, div_fp(turbo_pstate, current_pstate)); + busy_scaled = mul_fp(core_busy, div_fp(max_pstate, current_pstate)); return fp_toint(busy_scaled); }