Messages in this thread | | | Date | Fri, 3 Oct 2008 10:51:49 -0400 (EDT) | From | Alan Stern <> | Subject | Re: [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
| |