All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gautham R Shenoy <ego@linux.vnet.ibm.com>
To: Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>,
	Michael Neuling <mikey@neuling.org>,
	linuxppc-dev@lists.ozlabs.org, Anton Blanchard <anton@samba.org>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	linux-pm@vger.kernel.org
Subject: Re: [PATCH] powerpc/powernv/idle: Round up latency and residency values
Date: Thu, 24 Aug 2017 10:05:24 +0530	[thread overview]
Message-ID: <20170824043524.GA5695@in.ibm.com> (raw)
In-Reply-To: <20170823185841.25286-1-svaidy@linux.vnet.ibm.com>

Hi Vaidy,
On Thu, Aug 24, 2017 at 12:28:41AM +0530, Vaidyanathan Srinivasan
wrote:

Cc'ing Rafael and linux-pm list.

> On PowerNV platforms, firmware provides exit latency and
> target residency for each of the idle states in nano
> seconds.  Cpuidle framework expects the values in micro
> seconds.  Round up to nearest micro seconds to avoid errors
> in cases where the values are defined as fractional micro
> seconds.
> 
> Default idle state of 'snooze' has exit latency of zero.  If
> other states have fractional micro second exit latency, they
> would get rounded down to zero micro second and make cpuidle
> framework choose deeper idle state when snooze loop is the
> right choice.
> 
> Reported-by: Anton Blanchard <anton@samba.org>
> Signed-off-by: Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com>

This looks good to me.

Reviewed-by: Gautham R. Shenoy <ego@linux.vnet.ibm.com>
> ---
>  drivers/cpuidle/cpuidle-powernv.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/cpuidle/cpuidle-powernv.c b/drivers/cpuidle/cpuidle-powernv.c
> index 42896a67aeae..5f3922392059 100644
> --- a/drivers/cpuidle/cpuidle-powernv.c
> +++ b/drivers/cpuidle/cpuidle-powernv.c
> @@ -383,9 +383,9 @@ static int powernv_add_idle_states(void)
>  		 * Firmware passes residency and latency values in ns.
>  		 * cpuidle expects it in us.
>  		 */
> -		exit_latency = latency_ns[i] / 1000;
> +		exit_latency = DIV_ROUND_UP(latency_ns[i], 1000);
>  		if (!rc)
> -			target_residency = residency_ns[i] / 1000;
> +			target_residency = DIV_ROUND_UP(residency_ns[i], 1000);
>  		else
>  			target_residency = 0;
> 
> -- 
> 2.13.5
> 

  reply	other threads:[~2017-08-24  4:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-23 18:58 [PATCH] powerpc/powernv/idle: Round up latency and residency values Vaidyanathan Srinivasan
2017-08-24  4:35 ` Gautham R Shenoy [this message]
2017-08-24 10:28 ` Michael Ellerman
2017-08-24 13:07   ` Vaidyanathan Srinivasan
2017-11-14 11:12 ` Michael Ellerman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170824043524.GA5695@in.ibm.com \
    --to=ego@linux.vnet.ibm.com \
    --cc=anton@samba.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mikey@neuling.org \
    --cc=mpe@ellerman.id.au \
    --cc=rjw@rjwysocki.net \
    --cc=svaidy@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.