From patchwork Thu Oct 10 21:32:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rafael J. Wysocki" X-Patchwork-Id: 11184513 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 64A541864 for ; Thu, 10 Oct 2019 21:34:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4F7FA21D71 for ; Thu, 10 Oct 2019 21:34:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725867AbfJJVeT (ORCPT ); Thu, 10 Oct 2019 17:34:19 -0400 Received: from cloudserver094114.home.pl ([79.96.170.134]:43958 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726983AbfJJVeO (ORCPT ); Thu, 10 Oct 2019 17:34:14 -0400 Received: from 79.184.255.36.ipv4.supernova.orange.pl (79.184.255.36) (HELO kreacher.localnet) by serwer1319399.home.pl (79.96.170.134) with SMTP (IdeaSmtpServer 0.83.292) id e382dcc9448de146; Thu, 10 Oct 2019 23:34:12 +0200 From: "Rafael J. Wysocki" To: Linux PM Cc: LKML , Srinivas Pandruvada , Peter Zijlstra , Daniel Lezcano , Doug Smythies Subject: [PATCH 1/4] cpuidle: teo: Ignore disabled idle states that are too deep Date: Thu, 10 Oct 2019 23:32:17 +0200 Message-ID: <6803360.ubpITS43T2@kreacher> In-Reply-To: <60416800.X4hXmAfbqi@kreacher> References: <60416800.X4hXmAfbqi@kreacher> MIME-Version: 1.0 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org From: Rafael J. Wysocki Prevent disabled CPU idle state with target residencies beyond the anticipated idle duration from being taken into account by the TEO governor. Fixes: b26bf6ab716f ("cpuidle: New timer events oriented governor for tickless systems") Signed-off-by: Rafael J. Wysocki Acked-by: Doug Smythies --- drivers/cpuidle/governors/teo.c | 7 +++++++ 1 file changed, 7 insertions(+) Index: linux-pm/drivers/cpuidle/governors/teo.c =================================================================== --- linux-pm.orig/drivers/cpuidle/governors/teo.c +++ linux-pm/drivers/cpuidle/governors/teo.c @@ -258,6 +258,13 @@ static int teo_select(struct cpuidle_dri if (s->disabled || su->disable) { /* + * Ignore disabled states with target residencies beyond + * the anticipated idle duration. + */ + if (s->target_residency > duration_us) + continue; + + /* * If the "early hits" metric of a disabled state is * greater than the current maximum, it should be taken * into account, because it would be a mistake to select