]> git.hungrycats.org Git - linux/commit
[PATCH] /proc/interrupts allocates too much memory
authorAndrew Morton <akpm@digeo.com>
Sat, 12 Apr 2003 19:58:42 +0000 (12:58 -0700)
committerJames Bottomley <jejb@raven.il.steeleye.com>
Sat, 12 Apr 2003 19:58:42 +0000 (12:58 -0700)
commit873015a8c8de62f3c7ef5b3861d15b10ef7d438b
tree55cab83646e32b12bc347e3b2d64153d5cd5dcd7
parent830d6ef217c434096a324ca10ad236049f25b8ce
[PATCH] /proc/interrupts allocates too much memory

From: David Mosberger <davidm@napali.hpl.hp.com>

interrupts_open() can easily try to kmalloc() more memory than
supported by kmalloc.  E.g., with 16KB page size and NR_CPUS==64, it
would try to allocate 147456 bytes.

The workaround below is to allocate 4KB per 8 CPUs.  Not really a
solution, but the fundamental problem is that /proc/interrupts
shouldn't use a fixed buffer size in the first place.  I suppose
another solution would be to use vmalloc() instead.  It all feels like
bandaids though.
fs/proc/proc_misc.c