From patchwork Thu Jan 12 13:27:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Shi X-Patchwork-Id: 9513187 X-Patchwork-Delegate: rjw@sisk.pl 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 56FCE60476 for ; Thu, 12 Jan 2017 13:27:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 475CB286B9 for ; Thu, 12 Jan 2017 13:27:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 39A52286C4; Thu, 12 Jan 2017 13:27:26 +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.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, 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 A4776286B9 for ; Thu, 12 Jan 2017 13:27:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751132AbdALN1Y (ORCPT ); Thu, 12 Jan 2017 08:27:24 -0500 Received: from mail-pf0-f175.google.com ([209.85.192.175]:34669 "EHLO mail-pf0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751363AbdALN1W (ORCPT ); Thu, 12 Jan 2017 08:27:22 -0500 Received: by mail-pf0-f175.google.com with SMTP id 127so13448150pfg.1 for ; Thu, 12 Jan 2017 05:27:22 -0800 (PST) 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=+ZWcJ6q1nMa9Pm/K35tRiZgEU01+zQN4uJzIuVOykng=; b=UnqzJfQ3jXcmG86sPxDjPpPdq4VRo/S1wHNZPZDZrUagCJ+LBKFRUe0ujHrtXYUjce 1bVN1AALsZF+5fJPh/hOYrnsdVgaurC/km0sPBa5AzazK3SvWPn8DHZtS9pQO9vc5nGQ EgX746PMgDj9ooCbfnnkDsjEvuVXAypxXOIWw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=+ZWcJ6q1nMa9Pm/K35tRiZgEU01+zQN4uJzIuVOykng=; b=kKEc9I9JVtzUvC+FCfl9/6EamDpaoHmwewRChjzqOz30m0QezsELXXpe6F6bFPd5Uf jrDhkaji0/VaUMum/BspPN3Hn8bHzmSM4dZVw+o7osNL0Cry06OsfJ6yOyN6ZnUuCWJs yuLWIxJ7sjdzrZou5zlHlG5UwpYdkHF98lo9Ef5qY+K3q29LeEUtbLN+WQdCyB5RwzqW 11qbrApN1NgQW7oy5IMDbxeOrdhGY7ubIYZeS7xI2XdOEGnHDQwP8wBKYO5iIFV2bz2m CUTXdtQk2iYtPu29i53aPpigQmdz7k3IrfDocJOJNqXznPFNGyL5LBaoCP3l1kLsKVX4 ID+A== X-Gm-Message-State: AIkVDXJCCw/+2nYeigfF6FOmVmokcFZYotZcTLoxMYH06r/Y26SRjiDXA0tbFFU76li1+gPd X-Received: by 10.99.61.13 with SMTP id k13mr17467353pga.154.1484227641950; Thu, 12 Jan 2017 05:27:21 -0800 (PST) Received: from localhost.localdomain ([85.203.36.61]) by smtp.gmail.com with ESMTPSA id h17sm21849939pfh.62.2017.01.12.05.27.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 12 Jan 2017 05:27:21 -0800 (PST) From: Alex Shi To: Greg Kroah-Hartman , Daniel Lezcano , "Rafael J . Wysocki" , vincent.guittot@linaro.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Alex Shi , Ulf Hansson , Rasmus Villemoes , Arjan van de Ven , Rik van Riel Subject: [PATCH 1/3] cpuidle/menu: stop seeking deeper idle if current state is too deep Date: Thu, 12 Jan 2017 21:27:02 +0800 Message-Id: <1484227624-6740-2-git-send-email-alex.shi@linaro.org> X-Mailer: git-send-email 2.8.1.101.g72d917a In-Reply-To: <1484227624-6740-1-git-send-email-alex.shi@linaro.org> References: <1484227624-6740-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 Acked-by: Rik van Riel To: linux-kernel@vger.kernel.org Cc: linux-pm@vger.kernel.org Cc: Ulf Hansson Cc: Daniel Lezcano 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 d9b5b93..07e36bb 100644 --- a/drivers/cpuidle/governors/menu.c +++ b/drivers/cpuidle/governors/menu.c @@ -357,9 +357,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; }