From patchwork Thu Apr 23 07:20:33 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Wright X-Patchwork-Id: 19482 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n3N7Rs4A005201 for ; Thu, 23 Apr 2009 07:27:54 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754651AbZDWH1X (ORCPT ); Thu, 23 Apr 2009 03:27:23 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754814AbZDWH1W (ORCPT ); Thu, 23 Apr 2009 03:27:22 -0400 Received: from sous-sol.org ([216.99.217.87]:48156 "EHLO x200.localdomain" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754670AbZDWH1S (ORCPT ); Thu, 23 Apr 2009 03:27:18 -0400 Received: from x200.localdomain (x200.localdomain [127.0.0.1]) by x200.localdomain (8.14.3/8.14.3) with ESMTP id n3N7MNgJ024988; Thu, 23 Apr 2009 00:22:23 -0700 Received: (from chrisw@localhost) by x200.localdomain (8.14.3/8.14.3/Submit) id n3N7MIqp024987; Thu, 23 Apr 2009 00:22:18 -0700 X-Authentication-Warning: x200.localdomain: chrisw set sender to Chris Wright using -f Message-Id: <20090423072218.102318325@sous-sol.org> User-Agent: quilt/0.47-1 Date: Thu, 23 Apr 2009 00:20:33 -0700 From: Chris Wright To: linux-kernel@vger.kernel.org, stable@kernel.org Cc: Justin Forbes , Zwane Mwaikambo , "Theodore Ts'o" , Randy Dunlap , Dave Jones , Chuck Wolber , Chris Wedgwood , Michael Krufky , Chuck Ebbert , Domenico Andreoli , Willy Tarreau , Rodrigo Rubira Branco , Jake Edge , Eugene Teo , torvalds@linux-foundation.org, akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk, Len Brown , linux-acpi@vger.kernel.org, Venkatesh Pallipadi , Matthew Garrett , Len Brown Subject: [patch 013/100] ACPI: cap off P-state transition latency from buggy BIOSes References: <20090423072020.428683652@sous-sol.org> Content-Disposition: inline; filename=acpi-cap-off-p-state-transition-latency-from-buggy-bioses.patch Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org -stable review patch. If anyone has any objections, please let us know. --------------------- From: Venkatesh Pallipadi upstream commit: a59d1637eb0e0a37ee0e5c92800c60abe3624e24 Some BIOSes report very high frequency transition latency which are plainly wrong on CPus that can change frequency using native MSR interface. One such system is IBM T42 (2327-8ZU) as reported by Owen Taylor and Rik van Riel. cpufreq_ondemand driver uses this transition latency to come up with a reasonable sampling interval to sample CPU usage and with such high latency value, ondemand sampling interval ends up being very high (0.5 sec, in this particular case), resulting in performance impact due to slow response to increasing frequency. Fix it by capping-off the transition latency to 20uS for native MSR based frequency transitions. mjg: We've confirmed that this also helps on the X31 Signed-off-by: Venkatesh Pallipadi Acked-by: Matthew Garrett Signed-off-by: Len Brown Signed-off-by: Chris Wright --- arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) -- To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- a/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c +++ b/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c @@ -680,6 +680,18 @@ static int acpi_cpufreq_cpu_init(struct perf->states[i].transition_latency * 1000; } + /* Check for high latency (>20uS) from buggy BIOSes, like on T42 */ + if (perf->control_register.space_id == ACPI_ADR_SPACE_FIXED_HARDWARE && + policy->cpuinfo.transition_latency > 20 * 1000) { + static int print_once; + policy->cpuinfo.transition_latency = 20 * 1000; + if (!print_once) { + print_once = 1; + printk(KERN_INFO "Capping off P-state tranision latency" + " at 20 uS\n"); + } + } + data->max_freq = perf->states[0].core_frequency * 1000; /* table init */ for (i=0; istate_count; i++) {