lkml.org 
[lkml]   [2005]   [Sep]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [UPDATE PATCH][Bug 5132] fix sys_poll() large timeout handling
Nishanth Aravamudan <nacc@us.ibm.com> wrote:
>
> + /*
> + * We compare HZ with 1000 to work out which side of the
> + * expression needs conversion. Because we want to avoid
> + * converting any value to a numerically higher value, which
> + * could overflow.
> + */
> +#if HZ > 1000
> + overflow = timeout_msecs >= jiffies_to_msecs(MAX_SCHEDULE_TIMEOUT);
> +#else
> + overflow = msecs_to_jiffies(timeout_msecs) >= MAX_SCHEDULE_TIMEOUT;
> +#endif
> +
> + /*
> + * If we would overflow in the conversion or a negative timeout
> + * is requested, sleep indefinitely.
> + */
> + if (overflow || timeout_msecs < 0)
> + timeout_jiffies = MAX_SCHEDULE_TIMEOUT;

Do we need to test (timeout_msecs < 0) here? If we make timeout_msecs
unsigned long then I think `overflow' will always be correct.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-09-10 04:42    [W:0.057 / U:0.104 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site