lkml.org 
[lkml]   [2014]   [Oct]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: Why do we still have 32 bit counters? Interrupt counters overflow within 50 days
From
Date
On Fri, 2014-10-03 at 06:54 -0500, Christoph Lameter wrote:
> On Fri, 3 Oct 2014, Thomas Gleixner wrote:
>
> > > Is this the way its intended or should the counters be expanded to 64 bit?
> >
> > There is no reason why we cannot or should not expand them.
>
> Ok here is a patch to do just that:
>
>
> Subject: Increase irq counters to 64 bit
>
>
> Irq counters can overflow easily if they are just 32 bit.
>
> For example the timer interrupt occurs 1000 times per second, so
> it is predictable that the timer interrupt will overflow in
>
>
> 2^ 32 / 1000 [interrupts per second] / 86400 [seconds in a day]
>
> which results in 46 days.

dc -e "1 k 2 32 ^ 1000 / 86400 / p"
49.7

(That was the number I remembered from stories about a ancient Windows
lockup.)

> Other irq counters for devices may wrap even faster for example
> those for high speed networking devices.
>
> This patch is needed to avoid the counter overflow by increasing
> the counters to 64 bit.
>
> Signed-off-by: Christoph Lameter <cl@linux.com>


Paul Bolle




\
 
 \ /
  Last update: 2014-10-03 15:01    [W:0.064 / U:25.884 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site