Re: [PATCH] x86_64: Make NR_IRQS configurable in Kconfig

Andrew Morton
2006-08-07T23:56:17Z

On Mon, 07 Aug 2006 16:10:14 -0600
ebiederm@xmission.com (Eric W. Biederman) wrote:

> +/* We can be setup to receive at most NR_CPUS*224 irqs simultaneously */
> +#define NR_IRQS (CONFIG_NR_IRQS)

We know that setting this high can cause machines to run out of per-cpu
memory, so we're handing people a foot blowing-off tool here.

And it's a pretty nasty one because it can get people into the situation
where the kernel worked fine for those who released it, but users who
happen to load more modules (or the right combination of them) will
experience per-cpu memory exhaustion.

So shouldn't we being scaling the per-cpu memory as well?

If so, I'd suggest that we special-case that huge kstat structure. We can
calculate its size exactly, so how about we do:

#define SIZE_OF_KSTAT_THING <complicated expression>
#define PERCPU_ENOUGH_ROOM 32768

#define PERCPU_ENOUGH_ROOM_WHICH_WE_REALLY_USE \
PERCPU_ENOUGH_ROOM + SIZE_OF_KSTAT_THING

?

(And as it's a critical managed resource, I'm thinking that we should be
adding some /proc reporting of the per-cpu memory consumption..)