Re: [PATCH 3/7] Improve alloc_percpu: expose percpu_modalloc and percpu_modfree

From: Rusty Russell
Date: Mon Nov 17 2008 - 17:25:26 EST


On Tuesday 18 November 2008 00:17:13 JÃrn Engel wrote:
> On Mon, 17 November 2008 13:28:32 +0000, Rusty Russell wrote:
> > +static inline void *percpu_modalloc(unsigned long size, unsigned long align)
> > +{
> > + return kzalloc(size);
> > +}
>
> You didn't test the patches much, did you? :)

No, not UP :) I'd spent over four hours on them, so I figured it was time to
post them and get some concrete discussion.

Compiled and tested now, thanks!
Rusty.

cpualloc: Fixes for CONFIG_SMP=n

Signed-off-by: Rusty Russell <rusty@xxxxxxxxxxxxxxx>

diff -r 275b441d957b include/linux/percpu.h
--- a/include/linux/percpu.h Mon Nov 17 23:42:27 2008 +1030
+++ b/include/linux/percpu.h Tue Nov 18 08:52:05 2008 +1030
@@ -79,12 +79,16 @@
#else
static inline void *__alloc_percpu(unsigned long size, unsigned long align)
{
- return kzalloc(size);
+ return kzalloc(size, GFP_KERNEL);
}

static inline void free_percpu(void *pcpuptr)
{
kfree(pcpuptr);
+}
+
+static inline void percpu_alloc_init(void)
+{
}
#endif /* CONFIG_SMP */


--
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/