All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cpuidle: poll_state: Fix default time limit.
@ 2019-01-30 16:28 Doug Smythies
  2019-01-30 21:59 ` Rafael J. Wysocki
  0 siblings, 1 reply; 2+ messages in thread
From: Doug Smythies @ 2019-01-30 16:28 UTC (permalink / raw)
  To: rjw; +Cc: dsmythies, linux-kernel, linux-pm

The default time is declared in units of microsecnds,
but is used as nano seconds, resulting in significant
accounting errors for idle state 0 time when all idle
states deeper than 0 are disabled.

Under these unusual conditions, we don't really care
about the poll time limit anyhow.

Signed-off-by: Doug Smythies <dsmythies@telus.net>
---
 drivers/cpuidle/poll_state.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/cpuidle/poll_state.c b/drivers/cpuidle/poll_state.c
index b17d153..23a1b27 100644
--- a/drivers/cpuidle/poll_state.c
+++ b/drivers/cpuidle/poll_state.c
@@ -21,7 +21,7 @@ static int __cpuidle poll_idle(struct cpuidle_device *dev,
 	local_irq_enable();
 	if (!current_set_polling_and_test()) {
 		unsigned int loop_count = 0;
-		u64 limit = TICK_USEC;
+		u64 limit = TICK_NSEC;
 		int i;
 
 		for (i = 1; i < drv->state_count; i++) {
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] cpuidle: poll_state: Fix default time limit.
  2019-01-30 16:28 [PATCH] cpuidle: poll_state: Fix default time limit Doug Smythies
@ 2019-01-30 21:59 ` Rafael J. Wysocki
  0 siblings, 0 replies; 2+ messages in thread
From: Rafael J. Wysocki @ 2019-01-30 21:59 UTC (permalink / raw)
  To: Doug Smythies
  Cc: Rafael J. Wysocki, Doug Smythies, Linux Kernel Mailing List, Linux PM

On Wed, Jan 30, 2019 at 5:29 PM Doug Smythies <doug.smythies@gmail.com> wrote:
>
> The default time is declared in units of microsecnds,
> but is used as nano seconds, resulting in significant
> accounting errors for idle state 0 time when all idle
> states deeper than 0 are disabled.
>
> Under these unusual conditions, we don't really care
> about the poll time limit anyhow.
>
> Signed-off-by: Doug Smythies <dsmythies@telus.net>
> ---
>  drivers/cpuidle/poll_state.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/cpuidle/poll_state.c b/drivers/cpuidle/poll_state.c
> index b17d153..23a1b27 100644
> --- a/drivers/cpuidle/poll_state.c
> +++ b/drivers/cpuidle/poll_state.c
> @@ -21,7 +21,7 @@ static int __cpuidle poll_idle(struct cpuidle_device *dev,
>         local_irq_enable();
>         if (!current_set_polling_and_test()) {
>                 unsigned int loop_count = 0;
> -               u64 limit = TICK_USEC;
> +               u64 limit = TICK_NSEC;

Good catch!

>                 int i;
>
>                 for (i = 1; i < drv->state_count; i++) {
> --

Applied, thanks!

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-01-30 23:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-30 16:28 [PATCH] cpuidle: poll_state: Fix default time limit Doug Smythies
2019-01-30 21:59 ` Rafael J. Wysocki

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.