From patchwork Wed Jan 13 17:27:11 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudeep Holla X-Patchwork-Id: 59676 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp3499834lbb; Wed, 13 Jan 2016 09:27:15 -0800 (PST) X-Received: by 10.98.19.131 with SMTP id 3mr4499383pft.59.1452706035222; Wed, 13 Jan 2016 09:27:15 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q74si3147002pfa.198.2016.01.13.09.27.14; Wed, 13 Jan 2016 09:27:15 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dkim=neutral (body hash did not verify) header.i=@gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754487AbcAMR1N (ORCPT + 11 others); Wed, 13 Jan 2016 12:27:13 -0500 Received: from mail-ig0-f195.google.com ([209.85.213.195]:35990 "EHLO mail-ig0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753767AbcAMR1M (ORCPT ); Wed, 13 Jan 2016 12:27:12 -0500 Received: by mail-ig0-f195.google.com with SMTP id o2so18220817iga.3; Wed, 13 Jan 2016 09:27:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=VE4Ja4m1B3n3cF84R4fFOnNhpuUsfYJmYWyE/Iwe72s=; b=HplzpvSWeWduev52co+g/vpyzC6wzyhnpGIKIr+EzXvSWzXMqLCm/ZAlEBItymxI/D JpUj3XJ2sAIYspFjlJoGtVE1RPoxtE7aC285secK1ll2zS3KDczg2qS0TJyrJ0sK7iKj B+dihpFklExooV2Xwyq1UaE+3ghAqi8T+Q/Glapuy7Mnos+brDLI/xnjJRDu4C0RHQXi 9m9fBS3ETjL+CaZIHS7VwHdZnN5falwIm1zCwjHNgHGyH8y235pDi97vjZAh8LEqXdY8 mxu6mgmftbas2SK2muLuGUpdCIdbGlvfH1vu4ZkQye1IBAeCM0z6/nOX4PWrEbBjUxkW mBxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=VE4Ja4m1B3n3cF84R4fFOnNhpuUsfYJmYWyE/Iwe72s=; b=dif5tOX2Cdj8cEco8XkZpT5LA2ALYPX2kk3wPC+5dAenIBw9gc+oL945teh1gur67k f3tzooYgRM59IQSazvbxvccz+6aH53oSsawxUxeYrhb7gTddCz5ZhGJpvylLgb+1g9GZ Vs6PP1ot5ons+Zu8DPtdufIi+9wHRv8XMuhUQHwDkJOrY0sQRDXVyptUEPEKrld+l5Qr q2NuqjJodSgW6/vhytQAn8avEfEOFlYxxmkAbZlToWXzf+s9fJ1AiMTfMmmbtg8aCE7Y MkC/kY+01gAwmexlFZ86St+cIhjv4/hM+2k2RzjJsHqP/+WQVkf0sil6yMzG2NCzqvJT so8g== X-Gm-Message-State: ALoCoQkuoH80HRfer1tADXF8FyQzq/4A9wP02j8p+d6JRo88dLdV7u09EwZQGqPO9XohLSdU6Vsgv6POhHCozZl9tXQmv7gHvw== MIME-Version: 1.0 X-Received: by 10.50.156.103 with SMTP id wd7mr26086264igb.5.1452706031853; Wed, 13 Jan 2016 09:27:11 -0800 (PST) Received: by 10.64.16.135 with HTTP; Wed, 13 Jan 2016 09:27:11 -0800 (PST) In-Reply-To: <1446590059-18897-3-git-send-email-riel@redhat.com> References: <1446590059-18897-1-git-send-email-riel@redhat.com> <1446590059-18897-3-git-send-email-riel@redhat.com> Date: Wed, 13 Jan 2016 17:27:11 +0000 X-Google-Sender-Auth: jjny-dWWflooqnYGX5EZswZ3RQk Message-ID: Subject: Re: [PATCH 2/3] cpuidle, menu: use interactivity_req to disable polling From: Sudeep Holla To: riel@redhat.com, rafael.j.wysocki@intel.com Cc: Linux PM list , open list , arjan@linux.intel.com, Len Brown , daniel.lezcano@linaro.org, Sudeep Holla Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Hi Rik, This change break idle on ARM64(may be on other ARM?) platform. Sorry for reporting late, but missed to check cpuidle in -next. On Tue, Nov 3, 2015 at 10:34 PM, wrote: > From: Rik van Riel > > The menu governor carefully figures out how much time we typically > sleep for an estimated sleep interval, or whether there is a repeating > pattern going on, and corrects that estimate for the CPU load. > > Then it proceeds to ignore that information when determining whether > or not to consider polling. This is not a big deal on most x86 CPUs, > which have very low C1 latencies, and the patch should not have any > effect on those CPUs. > > However, certain CPUs (eg. Atom) have much higher C1 latencies, and > it would be good to not waste performance and power on those CPUs if > we are expecting a very low wakeup latency. > > Disable polling based on the estimated interactivity requirement, not > on the time to the next timer interrupt. > > Signed-off-by: Rik van Riel > --- > drivers/cpuidle/governors/menu.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/cpuidle/governors/menu.c b/drivers/cpuidle/governors/menu.c > index ecc242a586c9..b1a55731f921 100644 > --- a/drivers/cpuidle/governors/menu.c > +++ b/drivers/cpuidle/governors/menu.c > @@ -330,7 +330,7 @@ static int menu_select(struct cpuidle_driver *drv, struct cpuidle_device *dev) > * We want to default to C1 (hlt), not to busy polling > * unless the timer is happening really really soon. > */ > - if (data->next_timer_us > 20 && > + if (interactivity_req > 20 && I found that data->predicted_us is gets overwritten in get_typical_interval when avg computed = 0 which is the case initially on boot when the past intervals are not yet accumulated. I just tried a hack and that seem to work and proved what I anticipated (i.e. interactivity_req = 0). Let me know if you have any clues on how to solve it ? I can help you getting the change tested. Regards, Sudeep --->8 data->last_state_idx = CPUIDLE_DRIVER_STATE_START; -- To unsubscribe from this list: send the line "unsubscribe linux-pm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git i/drivers/cpuidle/governors/menu.c w/drivers/cpuidle/governors/menu.c index 7b0971d97cc3..7c7f4059705a 100644 --- i/drivers/cpuidle/governors/menu.c +++ w/drivers/cpuidle/governors/menu.c @@ -330,7 +330,8 @@ static int menu_select(struct cpuidle_driver *drv, struct cpuidle_device *dev) * We want to default to C1 (hlt), not to busy polling * unless the timer is happening really really soon. */ - if (interactivity_req > 20 && + if (((interactivity_req && interactivity_req > 20) || + data->next_timer_us > 20) && !drv->states[CPUIDLE_DRIVER_STATE_START].disabled && dev->states_usage[CPUIDLE_DRIVER_STATE_START].disable == 0)