From patchwork Thu Oct 8 00:13:23 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prarit Bhargava X-Patchwork-Id: 7347941 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id CE8109F443 for ; Thu, 8 Oct 2015 00:13:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F102F20610 for ; Thu, 8 Oct 2015 00:13:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0E5F8205DF for ; Thu, 8 Oct 2015 00:13:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752257AbbJHAN1 (ORCPT ); Wed, 7 Oct 2015 20:13:27 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38571 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752238AbbJHANZ (ORCPT ); Wed, 7 Oct 2015 20:13:25 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id 9909EC0BE066; Thu, 8 Oct 2015 00:13:24 +0000 (UTC) Received: from [10.16.186.145] (prarit-guest.khw.lab.eng.bos.redhat.com [10.16.186.145]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t980DN0k030141; Wed, 7 Oct 2015 20:13:23 -0400 Message-ID: <5615B523.8020501@redhat.com> Date: Wed, 07 Oct 2015 20:13:23 -0400 From: Prarit Bhargava User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Doug Smythies CC: "'Kristen Carlson Accardi'" , linux-kernel@vger.kernel.org, "'Viresh Kumar'" , linux-pm@vger.kernel.org, "'Rafael J. Wysocki'" Subject: Re: [PATCH] cpufreq, intel_pstate, set max_sysfs_pct and min_sysfs_pct on governor switch References: <1444168147-17812-1-git-send-email-prarit@redhat.com> <000f01d10131$59c67a60$0d536f20$@net> <56158F2D.50200@redhat.com> <10053399.aMfHfU7Xt3@vostro.rjw.lan> <001001d1014f$2613efe0$723bcfa0$@net> In-Reply-To: <001001d1014f$2613efe0$723bcfa0$@net> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, 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 On 10/07/2015 06:26 PM, Doug Smythies wrote: > On 2015.10.07 15:06 Rafael J. Wysocki wrote: >> On Wednesday, October 07, 2015 05:31:25 PM Prarit Bhargava wrote: >>> On 10/07/2015 02:52 PM, Doug Smythies wrote: >>>> On 2015.10.07 08:46 Prarit Bhargava wrote: >>>>> On 10/07/2015 11:40 AM, Doug Smythies wrote: >>>>>> >>>>>> Do we agree or disagree that the root issue seems to be (from your test)?: >>>>>> >>>>>> \# echo 100 > /sys/devices/system/cpu/intel_pstate/min_perf_pct >>>>>> >>>>>> [ 21.483436] store_min_perf_pct[453] min_sysfs_pct = 100 >>>>>> [ 21.489373] store_min_perf_pct[456] min_perf_pct = 100 >>>>>> [ 21.495203] store_min_perf_pct[459] min_perf_pct = 100 >>>>>> [ 21.501050] store_min_perf_pct[462] min_perf_pct = 100 >>>>> >>>>> Yep, and it appears to be done by default in Fedora & RHEL :/ ... the issue is >>>>> still the same IMO that min_sysfs_pct & max_sysfs_pct are not cleared on a >>>>> governor switch. >>>> >>>> Clearing them will break some other things. For example, and as >>>> shown in my original reply, resume from suspend. >>>> >>>> Why? Because, at least on my computer, the governor is changed to >>>> "performance" during suspend, and the "powersave" governor is >>>> restored sometime during resume. The users wants the settings they had >>>> before the suspend. >>>> >>> Looking at this in more detail after having tested on a Intel(R) Core(TM) >>> i7-2600 CPU @ 3.40GHz in Fedora and RHEL. >>> >>> I have a feeling that the switch you're seeing (poweersave->performance, suspend >>> ... resume, performance->powersave) is occurring in userspace, and not as a >>> result of the kernel. > Agreed. It is pm-suspend doing it. > >>> IMO if userspace changes the governor, all bets are off >>> on maintaining max_sysfs_pct and min_sysfs_pct. >>> >>> Here's something I cannot figure out (because I do not have an Ubuntu install). >>> *Why* is Ubuntu making the governor switch during suspend/resume? Is it >>> because of archaic brokeness they were trying to paper over? > >>> That's not limited to Ubuntu, pm-utils has been doing that forever. > > Agreed. This in pm-utils, and not limited to Ubuntu. > We can ignore this issue if everyone wants, but I can envision bug reports. > >> I have no idea why has it been doing that, though. I guess the reason >> was to "speed up" PM transitions (in case it started when you were in a >> low-frequency P-state and then there was no time to bump it up before >> things got too far). > > I have no idea either, but the stated theory seems sound. Doug, can you also apply (sorry for the cut-and-paste) and re-test? Thanks, P. > > --- To unsubscribe from this list: send the line "unsubscribe linux-pm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/pm/sleep.d/94cpufreq b/pm/sleep.d/94cpufreq index 6807681..2c83e8e 100755 --- a/pm/sleep.d/94cpufreq +++ b/pm/sleep.d/94cpufreq @@ -16,6 +16,8 @@ hibernate_cpufreq() gov="$x/cpufreq/scaling_governor" # if we do not have a scaling_governor file, skip. [ -f "$gov" ] || continue + # Is the governor known to work? + [ "$gov" == "intel_pstate" ] && continue # if our temporary governor is not available, skip. grep -q "$TEMPORARY_CPUFREQ_GOVERNOR" \ "$x/cpufreq/scaling_available_governors" || continue