From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759935AbYE3GVS (ORCPT ); Fri, 30 May 2008 02:21:18 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754016AbYE3GVH (ORCPT ); Fri, 30 May 2008 02:21:07 -0400 Received: from relay1.sgi.com ([192.48.171.29]:54271 "EHLO relay.sgi.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753967AbYE3GVE (ORCPT ); Fri, 30 May 2008 02:21:04 -0400 Date: Thu, 29 May 2008 23:21:02 -0700 (PDT) From: Christoph Lameter X-X-Sender: clameter@schroedinger.engr.sgi.com To: Rusty Russell cc: akpm@linux-foundation.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, David Miller , Eric Dumazet , Peter Zijlstra , Mike Travis Subject: Re: [patch 03/41] cpu alloc: Use cpu allocator instead of the builtin modules per cpu allocator In-Reply-To: <200805301608.01584.rusty@rustcorp.com.au> Message-ID: References: <20080530035620.587204923@sgi.com> <20080530040011.451400376@sgi.com> <200805301608.01584.rusty@rustcorp.com.au> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 30 May 2008, Rusty Russell wrote: > Hmm, does cpu_free(NULL, 0) do something? Seems like it shouldn't, for > symmetry with free(). No it just returns. > > + percpu = cpu_alloc(size, GFP_KERNEL|__GFP_ZERO, align); > > + if (!percpu) > > + printk(KERN_WARNING "Could not allocate %lu bytes percpu data\n", > > + size); > > if (!percpu) { > > err = -ENOMEM; > > goto free_mod; > > OK, we've *never* had a report of the per-cpu alignment message, so I'd be > happy to pass that through to cpu_alloc() and have it fail. Also, the if > (!percpu) cases should be combined. Ack. > > free_percpu: > > if (percpu) > > - percpu_modfree(percpu); > > + cpu_free(percpu, percpu_size); > > As above. The if can be dropped. > > > + goal = __per_cpu_size; > > Where did __per_cpu_size come from? I missed it in the earlier patches... Its __per_cpu_end - __per_cpu_start.