Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S263660AbTKKRds (ORCPT ); Tue, 11 Nov 2003 12:33:48 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S263661AbTKKRds (ORCPT ); Tue, 11 Nov 2003 12:33:48 -0500 Received: from fw.osdl.org ([65.172.181.6]:27857 "EHLO mail.osdl.org") by vger.kernel.org with ESMTP id S263660AbTKKRdq (ORCPT ); Tue, 11 Nov 2003 12:33:46 -0500 Date: Tue, 11 Nov 2003 09:29:31 -0800 From: "Randy.Dunlap" To: Erik Jacobson Cc: linux-kernel@vger.kernel.org Subject: Re: 2.6 /proc/interrupts fails on systems with many CPUs Message-Id: <20031111092931.7b6d1d91.rddunlap@osdl.org> In-Reply-To: References: Organization: OSDL X-Mailer: Sylpheed version 0.9.4 (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: +5V?h'hZQPB9kW Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1262 Lines: 37 On Tue, 11 Nov 2003 11:21:01 -0600 Erik Jacobson wrote: | Howdy. | | On systems with lots of processors (512 for example), catting /proc/interrupts | fails with a "not enough memory" error. | | This was observed in 2.6.0-test8 | | I tracked this down to this in proc_misc.c: | | static int interrupts_open(struct inode *inode, struct file *file) | { | unsigned size = 4096 * (1 + num_online_cpus() / 8); | char *buf = kmalloc(size, GFP_KERNEL); | | The kmalloc fails here. | | I'm looking for suggestions on how to fix this. I came up with one fix | that seems to work OK for ia64. I have attached it to this message. | I'm looking for advice on what should be proposed for the real fix. An alternative is to limit 'size' to a maximum of 128 KB (or whatever the max. kmalloc() on ia64 is) and continue to use kmalloc(). Does that work for you? Another alternative is to convert show_interrupts to use a seq_file iterator. -- ~Randy MOTD: Always include version info. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/