[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4A208538.3040406@ti.com>
Date: Fri, 29 May 2009 20:00:40 -0500
From: Jon Hunter <jon-hunter@...com>
To: Thomas Gleixner <tglx@...utronix.de>
CC: john stultz <johnstul@...ibm.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Ingo Molnar <mingo@...e.hu>
Subject: Re: [PATCH 1/2] Dynamic Tick: Prevent clocksource wrapping during
idle
Jon Hunter wrote:
> + * Calculate the time delta for the next timer event.
> + * If the time delta exceeds the maximum time delta
> + * permitted by the current clocksource then adjust
> + * the time delta accordingly to ensure the
> + * clocksource does not wrap.
> + */
> + time_delta = tick_period.tv64 * delta_jiffies;
Thinking about this more, although it is very unlikely, for 64-bit
machines there is a chance that the above multiply could overflow if
delta_jiffies is very large.
tick_period.tv64 should always be less than NSEC_PER_SEC and so you
would need delta_jiffies to be greater than 2^32 to cause overflow. On a
32-bit machine an unsigned long will not be greater than 2^32 as it is
only 32-bits but this would be possible on a 64-bit machines.
So to be safe we should make sure that delta_jiffies is not greater than
NEXT_TIMER_MAX_DELTA (2^30 - 1) before doing the multiply. If you
think that this is a valid concern, then I can re-work and re-post.
Sorry for not catching this before.
Jon
--
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