From patchwork Fri Aug 19 08:25:13 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Shi X-Patchwork-Id: 74217 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp195975qga; Fri, 19 Aug 2016 01:26:07 -0700 (PDT) X-Received: by 10.66.242.201 with SMTP id ws9mr11498833pac.7.1471595167156; Fri, 19 Aug 2016 01:26:07 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v12si3967182pfi.276.2016.08.19.01.26.05; Fri, 19 Aug 2016 01:26:07 -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=fail 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=fail (p=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754800AbcHSIZp (ORCPT + 27 others); Fri, 19 Aug 2016 04:25:45 -0400 Received: from mail-pa0-f41.google.com ([209.85.220.41]:35861 "EHLO mail-pa0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754479AbcHSIZb (ORCPT ); Fri, 19 Aug 2016 04:25:31 -0400 Received: by mail-pa0-f41.google.com with SMTP id pp5so14155730pac.3 for ; Fri, 19 Aug 2016 01:25:31 -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=gG5DqAtjtxp72xeCk+9fNkOtXzcWY21ivprrvwCK3oM=; b=dQHtDI/eRebbINe+DsL11lJdrsNlIoOg8HLlVNQ3vAXy2UTCpaI0DK8EauWP4QlECj +8voIgNQiQ6RfoZyyey2b6ydMlCvMHUct9QH07l3cWo8JZFnRCM/qZNO+BDIZ2nRP6X7 qWP0UbuSuw1RX7WeGUTeqtQY1nTJLicVFVv9c= 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=gG5DqAtjtxp72xeCk+9fNkOtXzcWY21ivprrvwCK3oM=; b=lij6XagMJvEVasiz3xNja7ugdKyFzJQv4w71unBnWnKPswivjjCOK0+Tyi1CGiGa2f NXNd55IvOEEy4P8nNPYSuo/AcsTFKp+QIJSKfn35ImH4DTIAE7B3bsr+XJ3nhCFuMBRX FBuMuuW2dFDaW5C/Lrnd6hLfpZWAnx8VEsbC3/8dMsn6L77hASaK7rfTvJJp8Nj/ZCCT kxyGKWnLD4iBLnKFUpIiDEpVJIqWMrq6aNDMidqorzm/dqDtJNk6RS+tO0DQLQD5FYO/ cXieEDJ3jcCshnC5YGh0mxrzpjDKmuu5T3ecgPkDcAwKl1yR+2HuNByrmczM50b9ppX9 Il8w== X-Gm-Message-State: AEkoouuL4AdgQZ6oHTymERYMatFjCCzXtrooJErJFDs/S7m/x6PY9Ah+9/ZF2mAk8iQEle97 X-Received: by 10.66.189.199 with SMTP id gk7mr11661675pac.158.1471595125471; Fri, 19 Aug 2016 01:25:25 -0700 (PDT) Received: from localhost.localdomain ([139.59.249.186]) by smtp.gmail.com with ESMTPSA id p4sm4290183pfp.60.2016.08.19.01.25.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 19 Aug 2016 01:25:25 -0700 (PDT) From: Alex Shi Cc: Daniel Lezcano , Rasmus Villemoes , Arjan van de Ven , Rik van Riel , "Rafael J. Wysocki" , linux-kernel@vger.kernel.org (open list) Subject: [PATCH 3/4] cpuidle/menu: stop seeking deeper idle if current state is too deep Date: Fri, 19 Aug 2016 16:25:13 +0800 Message-Id: <1471595114-1688-3-git-send-email-alex.shi@linaro.org> X-Mailer: git-send-email 2.8.1.101.g72d917a In-Reply-To: <1471595114-1688-1-git-send-email-alex.shi@linaro.org> References: <1471595114-1688-1-git-send-email-alex.shi@linaro.org> To: unlisted-recipients:; (no To-header on input) 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: Daniel Lezcano Cc: Rasmus Villemoes Cc: Alex Shi 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; }