Re: [PATCH] Allocate module.ref array dynamically
From: Christoph Lameter
Date: Thu Nov 13 2008 - 09:41:44 EST
On Thu, 13 Nov 2008, Rusty Russell wrote:
> > The cpu alloc patchset gets rid of about half the hooks in the page
> > allocator and slab allocator.
>
> Sure, but we could convert those today to alloc_percpu etc.
The percpu_ptr macros etc are not upercase suggesting that it is a
function but the functions do weird things like passing through the
type. This is confusing.
alloc_percpu() does not allow specifying a GFP mask therefore does not
support zeroing and is not extendable for the future. It does not allow
specifying an alignment therefore tight packing is not possible.
Plus the name alloc_percpu() suggests that it is a function but its a
macro doing things with typing.
CPU_PTR and THIS_CPU can be applied both to percpu pointers and
percpu variables. The new API unifies the handling which is required in
order for the new cpu_ops to work both on statically and dynamically
allocated percpu data.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/