Subject: Re: [PATCH] hvc_console polling mode timer backoff

From: Milton Miller <[email-masked]>
Date: Sat, 14 Apr 2007 14:42:02 -0500

Michael Ellerman wrote:

> + * msleep until we reach the max.  This may be noticable as a brief 
> (average
> + * one second) delay on the console before the console responds to 
> input when
> + * there has been no input for sometime.
> + */
> +#define MIN_TIMEOUT            (10)
> +#define MAX_TIMEOUT            (2000)
> +static u32 timeout = MIN_TIMEOUT;

Did you consider making MAX_TIMEOUT a module parameter?   It could then
be changed at runtime through /sys/modules/.

> +
> +                               if (timeout < MAX_TIMEOUT)
> +                                       timeout += (timeout >> 6) + 1;

Keeping MIN_TIMEOUT a define is okay with me, and the code will
naturally ignore max < MIN.  It may overshoot timeout by 1/64th.

I doubt we would worry about the overflow case, because by then
the timeout would have been quite long, and the user would like
it to be short again.

milton