lkml.org 
[lkml]   [2008]   [May]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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.



\
 
 \ /
  Last update: 2008-05-30 08:23    [W:0.131 / U:0.560 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site