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: 74670 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp725939qga; Thu, 25 Aug 2016 01:44:59 -0700 (PDT) X-Received: by 10.98.61.24 with SMTP id k24mr13990698pfa.100.1472114699270; Thu, 25 Aug 2016 01:44:59 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r77si14497122pfb.132.2016.08.25.01.44.55; Thu, 25 Aug 2016 01:44:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933774AbcHYIow (ORCPT + 27 others); Thu, 25 Aug 2016 04:44:52 -0400 Received: from mail-pa0-f52.google.com ([209.85.220.52]:35861 "EHLO mail-pa0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933615AbcHYInk (ORCPT ); Thu, 25 Aug 2016 04:43:40 -0400 Received: by mail-pa0-f52.google.com with SMTP id di2so15071634pad.3 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=ktkyRmYoPnFmso7vL3kPn/r3Xnh16ReubqTEwWKkRmSZotZxXw5FjXdzTxjmqeDlqM 19wD2/ZAyzS+ifN077m6Y60VhrnjtxxXUfELPbSTlZDb/qtq73XM1OdRk5szw7z5MM0L TUdUFhTlmOyFOqnbWAgMogBKk6MCBkeUlG9OIoxXmFYkfBaFe72GQo4T2FGSaEMXZL8g DpLOt97sTW1aZaL4XavrTiEZshXkbS6Cx6zQFDUJ00DM6Il4CbOSH+tPPljrgTd0z+qC 8CVdc9tiMpjWOWAsd0M1lKPJJykrAmjvuHb81vMR5o7NPpHohoSGdgobXV1rb/cQTPAL Yv/A== X-Gm-Message-State: AE9vXwPhJUwVw6eMqNjevAF/B1qVeZVgSLv6Amt1HidytRk6MGFXOSox3vFRN4ORtCE64jQm 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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(-) -- 2.8.1.101.g72d917a 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; }