From patchwork Fri Mar 11 20:30:44 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rik van Riel X-Patchwork-Id: 8568951 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 4F812C0553 for ; Fri, 11 Mar 2016 20:30:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 632FD20253 for ; Fri, 11 Mar 2016 20:30:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 639C420260 for ; Fri, 11 Mar 2016 20:30:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751072AbcCKUat (ORCPT ); Fri, 11 Mar 2016 15:30:49 -0500 Received: from mx1.redhat.com ([209.132.183.28]:42071 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750953AbcCKUat (ORCPT ); Fri, 11 Mar 2016 15:30:49 -0500 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 12CBEC00DE15; Fri, 11 Mar 2016 20:30:48 +0000 (UTC) Received: from annuminas.surriel.com (ovpn-116-37.rdu2.redhat.com [10.10.116.37]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u2BKUjZr024280; Fri, 11 Mar 2016 15:30:46 -0500 Date: Fri, 11 Mar 2016 15:30:44 -0500 From: Rik van Riel To: "Doug Smythies" Cc: "'Rafael J. Wysocki'" , "'Rafael J. Wysocki'" , "'Viresh Kumar'" , "'Srinivas Pandruvada'" , "'Chen, Yu C'" , , "'Arto Jantunen'" , "'Len Brown'" Subject: Re: SKL BOOT FAILURE unless idle=nomwait (was Re: PROBLEM: Cpufreq constantly keeps frequency at maximum on 4.5-rc4) Message-ID: <20160311153044.1a3be1c6@annuminas.surriel.com> In-Reply-To: <002401d17bc2$fad32af0$f07980d0$@net> References: <87si087tsr.fsf@iki.fi> <87a8m74mcc.fsf@iki.fi> <002d01d17a57$ec417030$c4c45090$@net> <003701d17a5d$cab287a0$601796e0$@net> <20160311090306.1bfe380b@annuminas.surriel.com> <002401d17bc2$fad32af0$f07980d0$@net> Organization: Red Hat, Inc. MIME-Version: 1.0 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, 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 Fri, 11 Mar 2016 10:22:30 -0800 "Doug Smythies" wrote: > On 2016.03.11 06:03 Rik van Riel wrote: > > On Thu, 10 Mar 2016 00:59:01 +0100 "Rafael J. Wysocki" wrote: > > The patch below should fix that. > > > > It didn't for Arto, due to the other issues on his system, but > > it might resolve the issue for Doug, where cstate/pstate is > > otherwise working fine. > > > > Doug, does the patch below solve your issue? > > No. OK, lets try doing this check a little more aggressively, since there almost certainly are good reasons why the main selection loop in menu_select() so aggressively tries to stay with shallower C states. With the patch below, we compare the (not corrected for load) expected sleep time against the target residency of the C1 (hlt) state on the CPU. This might resolve the issue, while still doing the right thing on CPUs that have really high C1 latencies (eg. Atom). Does this resolve the issue for you? ---8<--- Subject: cpuidle: use predicted_us not interactivity_req to consider polling The interactivity_req variable is the expected sleep time, divided by the CPU load. This can be too aggressive a factor in deciding whether or not to consider polling in the cpuidle state selection. Use the (not corrected for load) predicted_us instead, and compare it against the target residency of C1 (hlt). Signed-off-by: Rik van Riel --- drivers/cpuidle/governors/menu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 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/drivers/cpuidle/governors/menu.c b/drivers/cpuidle/governors/menu.c index 0742b3296673..7dda15cfe547 100644 --- a/drivers/cpuidle/governors/menu.c +++ b/drivers/cpuidle/governors/menu.c @@ -330,7 +330,7 @@ static int menu_select(struct cpuidle_driver *drv, struct cpuidle_device *dev) * We want to default to C1 (hlt), not to busy polling * unless the timer is happening really really soon. */ - if (interactivity_req > 20 && + if (data->predicted_us > drv->states[CPUIDLE_DRIVER_STATE_START].target_residency && !drv->states[CPUIDLE_DRIVER_STATE_START].disabled && dev->states_usage[CPUIDLE_DRIVER_STATE_START].disable == 0) data->last_state_idx = CPUIDLE_DRIVER_STATE_START;