Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S263596AbTKKRVO (ORCPT ); Tue, 11 Nov 2003 12:21:14 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S263628AbTKKRVO (ORCPT ); Tue, 11 Nov 2003 12:21:14 -0500 Received: from tolkor.sgi.com ([198.149.18.6]:16585 "EHLO tolkor.sgi.com") by vger.kernel.org with ESMTP id S263596AbTKKRVD (ORCPT ); Tue, 11 Nov 2003 12:21:03 -0500 Date: Tue, 11 Nov 2003 11:21:01 -0600 From: Erik Jacobson To: linux-kernel@vger.kernel.org Subject: 2.6 /proc/interrupts fails on systems with many CPUs Message-ID: MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="-2136806248-1103982938-1068571261=:360387" Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 5986 Lines: 118 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. Send mail to mime@docserver.cac.washington.edu for more info. ---2136806248-1103982938-1068571261=:360387 Content-Type: TEXT/PLAIN; charset=US-ASCII 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. Thanks! -- Erik Jacobson - Linux System Software - Silicon Graphics - Eagan, Minnesota ---2136806248-1103982938-1068571261=:360387 Content-Type: TEXT/PLAIN; charset=US-ASCII; name="foo.bar" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: attachment; filename="foo.bar" DQo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09P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DQogCQlpZiAoIW0tPmJ1ZikNCiAJCQln b3RvIEVub21lbTsNCiAJCW0tPmNvdW50ID0gMDsNCkBAIC0xNjAsNyArMTYy LDcgQEANCiAJaWYgKCFvZmZzZXQpDQogCQlyZXR1cm4gMDsNCiAJaWYgKCFt LT5idWYpIHsNCi0JCW0tPmJ1ZiA9IGttYWxsb2MobS0+c2l6ZSA9IFBBR0Vf U0laRSwgR0ZQX0tFUk5FTCk7DQorCQltLT5idWYgPSBfX3ZtYWxsb2MobS0+ c2l6ZSA9IFBBR0VfU0laRSwgR0ZQX0tFUk5FTCwgUEFHRV9LRVJORUwpOw0K IAkJaWYgKCFtLT5idWYpDQogCQkJcmV0dXJuIC1FTk9NRU07DQogCX0NCkBA IC0xOTIsOCArMTk0LDggQEANCiANCiBFb3ZlcmZsb3c6DQogCW0tPm9wLT5z dG9wKG0sIHApOw0KLQlrZnJlZShtLT5idWYpOw0KLQltLT5idWYgPSBrbWFs bG9jKG0tPnNpemUgPDw9IDEsIEdGUF9LRVJORUwpOw0KKwl2ZnJlZShtLT5i dWYpOw0KKwltLT5idWYgPSBfX3ZtYWxsb2MobS0+c2l6ZSA8PD0gMSwgR0ZQ X0tFUk5FTCwgUEFHRV9LRVJORUwpOw0KIAlyZXR1cm4gIW0tPmJ1ZiA/IC1F Tk9NRU0gOiAtRUFHQUlOOw0KIH0NCiANCkBAIC0yNDYsNyArMjQ4LDcgQEAN CiBpbnQgc2VxX3JlbGVhc2Uoc3RydWN0IGlub2RlICppbm9kZSwgc3RydWN0 IGZpbGUgKmZpbGUpDQogew0KIAlzdHJ1Y3Qgc2VxX2ZpbGUgKm0gPSAoc3Ry dWN0IHNlcV9maWxlICopZmlsZS0+cHJpdmF0ZV9kYXRhOw0KLQlrZnJlZSht LT5idWYpOw0KKwl2ZnJlZShtLT5idWYpOw0KIAlrZnJlZShtKTsNCiAJcmV0 dXJuIDA7DQogfQ0K ---2136806248-1103982938-1068571261=:360387-- - 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/