From patchwork Thu Aug 25 08:42:41 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Shi X-Patchwork-Id: 9298967 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 432A260757 for ; Thu, 25 Aug 2016 08:45:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3456D291C1 for ; Thu, 25 Aug 2016 08:45:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 28F8429204; Thu, 25 Aug 2016 08:45:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C967B291C1 for ; Thu, 25 Aug 2016 08:45:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933078AbcHYIoq (ORCPT ); Thu, 25 Aug 2016 04:44:46 -0400 Received: from mail-pa0-f47.google.com ([209.85.220.47]:33620 "EHLO mail-pa0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933616AbcHYInk (ORCPT ); Thu, 25 Aug 2016 04:43:40 -0400 Received: by mail-pa0-f47.google.com with SMTP id ti13so15116090pac.0 for ; Thu, 25 Aug 2016 01:42:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=KjTtxotW1wgroCcQAYc390AGZ44KdZVWMTdZuRGLHVY=; b=Mbso3x1/sglYsdt99h7Hj1sZgNZSa0Xcey6iZXL7Z+UyEZDxMrT5wnf4ty7+EqIEm8 8szGkbCagPEQ4/qS3GQGAqOErM5lh1Uk09xhYgRFmrfxps573MnijTXn9TgS+jhZgZpd btkeO/4GoOxF7uvpQZmlkQIPMSr7T9rC0irOA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=KjTtxotW1wgroCcQAYc390AGZ44KdZVWMTdZuRGLHVY=; b=KAW4UVr9OyhAU5MXjrQsiD+0+EivW3CwF4QLWIs8BYQc/baFTdMvLqP0xx2FXnPf4p HqAIS+40zfKI1kUWHH7G6YCyZNQJfWyiEu7ywlldbpS5yTgy7+rEV1t67/Sr5sgCaxOE 4A6O/d0KCsCc3KjDlsXtaBf41ZhBYuwQAkhcakwac/u+bj0kIQM81JyI9kG8cQA2wC/6 8gnxA6pr5MNdJDtyjFyEutKY+S5pagTO/E/HOBJ8q0GzOGOAZ+45l3bZ6I7QBLmGN/Xr zrzgk9pn3uWYUXRoRxkxvRi/cK20CuqQIZSmqFDtGZIDgMSQkYRvX8h3mjsVzzpkdFhF g6wQ== X-Gm-Message-State: AE9vXwNd2K1YxJM7LIuG3d98UuFq509wqdX9GjNNB98AOXeRhVR8aOg8DrlVCI9CdueK+Rg9 X-Received: by 10.66.146.69 with SMTP id ta5mr14077127pab.157.1472114574828; Thu, 25 Aug 2016 01:42:54 -0700 (PDT) Received: from localhost.localdomain ([139.59.249.186]) by smtp.gmail.com with ESMTPSA id h66sm19016433pfe.58.2016.08.25.01.42.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 25 Aug 2016 01:42:54 -0700 (PDT) From: Alex Shi To: linux-kernel@vger.kernel.org (open list) Cc: linux-pm@vger.kernel.org, Ulf Hansson , Daniel Lezcano , Rasmus Villemoes , Arjan van de Ven , Rik van Riel , "Rafael J. Wysocki" Subject: [PATCH 3/4] cpuidle/menu: stop seeking deeper idle if current state is too deep Date: Thu, 25 Aug 2016 16:42:41 +0800 Message-Id: <1472114562-2736-3-git-send-email-alex.shi@linaro.org> X-Mailer: git-send-email 2.8.1.101.g72d917a In-Reply-To: <1472114562-2736-1-git-send-email-alex.shi@linaro.org> References: <1472114562-2736-1-git-send-email-alex.shi@linaro.org> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The obsolete commit 71abbbf85 want to introduce a dynamic cstates, but it was removed for long time. Just left the nonsense deeper cstate checking. Since all target_residency and exit_latency are going longer in deeper idle state, no needs to waste some cpu cycle on useless seeking. Signed-off-by: Alex Shi To: linux-kernel@vger.kernel.org Cc: linux-pm@vger.kernel.org Cc: Ulf Hansson Cc: Daniel Lezcano Cc: Alex Shi Cc: Rasmus Villemoes Cc: Arjan van de Ven Cc: Rik van Riel Cc: "Rafael J. Wysocki" --- drivers/cpuidle/governors/menu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/cpuidle/governors/menu.c b/drivers/cpuidle/governors/menu.c index 03d38c2..bb58e2a 100644 --- a/drivers/cpuidle/governors/menu.c +++ b/drivers/cpuidle/governors/menu.c @@ -358,9 +358,9 @@ static int menu_select(struct cpuidle_driver *drv, struct cpuidle_device *dev) if (s->disabled || su->disable) continue; if (s->target_residency > data->predicted_us) - continue; + break; if (s->exit_latency > latency_req) - continue; + break; data->last_state_idx = i; }