Re: Why do we still have 32 bit counters? Interrupt counters overflow within 50 days

From: Thomas Gleixner
Date: Sun Oct 05 2014 - 17:49:24 EST


On Fri, 3 Oct 2014, Christoph Lameter wrote:
> On Fri, 3 Oct 2014, Richard Cochran wrote:
>
> > > DECLARE_PER_CPU(char *, irq_stack_ptr);
> > > -DECLARE_PER_CPU(unsigned int, irq_count);
> > > +DECLARE_PER_CPU(unsigned long, irq_count);
> >
> > Still 32 bit on 32 bit machines...
>
> 64 bit counters on 32 bit machines are not an easy thing and could be

Whats so hard about 64bit counters on 32bit machines?

> expensive to handle in particular because these counters are used in
> performance critical hotpaths.

The expensive overhead is a single "adcl" instruction.

> I thought I better leave it alone on 32 bit.

And how exactly are we supposed to explain the different behaviour to
users?

Thanks,

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