[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.44L0.0810031043590.2500-100000@iolanthe.rowland.org>
Date: Fri, 3 Oct 2008 10:51:49 -0400 (EDT)
From: Alan Stern <stern@...land.harvard.edu>
To: Andrew Morton <akpm@...ux-foundation.org>
cc: yi.y.yang@...el.com, <linux-kernel@...r.kernel.org>,
<dbrownell@...rs.sourceforge.net>, <gregkh@...e.de>,
<linux-usb@...r.kernel.org>
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists