Re: [PATCH 4/4] kstat: modify kstat_irqs_legacy to be variable sized

Mike Travis
2009-01-11T04:32:30Z

Ingo Molnar wrote:
> * Mike Travis <travis@sgi.com> wrote:
...
>>>> Allocate kstat_irqs_legacy based on nr_cpu_ids to deal with this
>>>> memory usage bump when NR_CPUS bumped from 128 to 4096:
>>>>
>>>> 8192 +253952 262144 +3100% kstat_irqs_legacy(.bss)
>>>>
...
>>>> + /* allocate based on nr_cpu_ids */
>>>> + kstat_irqs_legacy = alloc_bootmem(NR_IRQS_LEGACY * nr_cpu_ids *
>>>> + sizeof(int));
...
>>> btw., while at it - dont we want to upgrade this to a 'long' (in a
>>> separate commit)? Having more than 4 billion irqs after bootup is easily
>>> possible.

Looking at this more closely, it seems it would be better to per_cpu_alloc
the legacy kstat_irqs as that would place the value being incremented on the
node of the cpu doing the incrementing.

This, of course, would need the early per_cpu_alloc (in bootmem) that
the new cpu_alloc changes from Christoph and Rusty is providing.

Thanks,
Mike