lkml.org 
[lkml]   [2008]   [Oct]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] USB: improve ehci_watchdog's side effect in CPU power management
Responding just Andrew's comments, disregarding whether or not the 
patch itself is worthwhile...

On Thu, 2 Oct 2008, Andrew Morton wrote:

> <looks>
>
> <regrets it>
>
>
> Why does this:
>
> t = DIV_ROUND_UP(EHCI_SHRINK_FRAMES * HZ, 1000) + 1;
>
> add "1000" to a jiffies value when it doesn't know what HZ is? It'll
> be adding anywhere from one second up to ten seconds to the timeout
> interval depending upon compile-time options.

Look again. The macro doesn't _add_ 1000 to a jiffies value; it
_divides_ the value by 1000. This is because EHCI_SHRINK_FRAMES is in
milliseconds.

However this could be changed to

t = msecs_to_jiffies(EHCI_SHRINK_FRAMES) + 1;

even though that would involve more runtime code.

> I suspect s/1000/HZ/ would improve things here. Or just delete it -
> doesn't the subsequent round_jiffies() do the same thing, only better?
> This code needs help, I suspect.

That subsequent round_jiffies() is most likely a mistake.

> Also, do we really need to inline this large function into at least
> five callsites?

I agree; this function should not be inline.

Alan Stern



\
 
 \ /
  Last update: 2008-10-03 16:55    [W:0.090 / U:0.076 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site