From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Morton Subject: Re: [patch 03/41] cpu alloc: Use cpu allocator instead of the builtin modules per cpu allocator Date: Thu, 29 May 2008 21:58:37 -0700 Message-ID: <20080529215837.0528fb3b.akpm@linux-foundation.org> References: <20080530035620.587204923@sgi.com> <20080530040011.451400376@sgi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Return-path: Received: from smtp1.linux-foundation.org ([140.211.169.13]:53979 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753039AbYE3E66 (ORCPT ); Fri, 30 May 2008 00:58:58 -0400 In-Reply-To: <20080530040011.451400376@sgi.com> Sender: linux-arch-owner@vger.kernel.org List-ID: To: Christoph Lameter Cc: linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, David Miller , Eric Dumazet , Peter Zijlstra , Rusty Russell , Mike Travis On Thu, 29 May 2008 20:56:23 -0700 Christoph Lameter wrote: > Remove the builtin per cpu allocator from modules.c and use cpu_alloc instead. > > The patch also removes PERCPU_ENOUGH_ROOM. The size of the cpu_alloc area is > determined by CONFIG_CPU_AREA_SIZE. PERCPU_ENOUGH_ROOMs default was 8k. > CONFIG_CPU_AREA_SIZE defaults to 30k. Thus we have more space to load modules. > > > ... > > + unsigned long align = sechdrs[pcpuindex].sh_addralign; > + unsigned long size = sechdrs[pcpuindex].sh_size; > + > + if (align > PAGE_SIZE) { > + printk(KERN_WARNING "%s: per-cpu alignment %li > %li\n", > + mod->name, align, PAGE_SIZE); Indenting broke. Alas, PAGE_SIZE has, iirc, unsigned type on some architectures and unsigned long on others. I suspect you'll need to cast it to be able to print it. > + align = PAGE_SIZE; > + } > + percpu = cpu_alloc(size, GFP_KERNEL|__GFP_ZERO, align); > + if (!percpu) > + printk(KERN_WARNING "Could not allocate %lu bytes percpu data\n", 80-col bustage,. A printk like this should, I think, identify what part of the kernel it came from. But really, I don't think any printk should be present here. cpu_alloc() itself should dump the warning and the backtrace when it runs out. Because a cpu_alloc() failure is a major catastrophe. It probably means a reconfigure-and-reboot cycle. Right now it means a reconfigure-kernel-rebuild-kernel-reinstall-kernel-then-reboot cycle. Or a call-vendor-complain-pay-money-and-wait cycle. But I hope we can fix that with the boot parameter thing?