RE: [PATCH v1 1/8] perf: Increase MAX_NR_CPUS to 4096

From: David Laight
Date: Mon Dec 09 2024 - 16:37:00 EST


..
> > > Just changing the int to be a s16 would lower the memory overhead,
> > > which is why I'd kind of like the abstraction to be minimal.
> >
> > Here I am not clear what for "changing the int to be a s16". Could you
> > elaberate a bit for this?
>
> I meant this :-)
> https://lore.kernel.org/lkml/20241207052133.102829-1-irogers@xxxxxxxxxx/

How many time is this allocated?
If it is 2 bytes in a larger structure it is likely to be noise.
For a local the code is likely to be worse.
Any maths and you start forcing the compiler to mask the value
(on pretty much anything except x86).

David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)