Messages in this thread | | | Date | Thu, 29 May 2008 23:21:02 -0700 (PDT) | From | Christoph Lameter <> | Subject | Re: [patch 03/41] cpu alloc: Use cpu allocator instead of the builtin modules per cpu allocator |
| |
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.
| |