Re: [PATCH] kmalloc_percpu

Rusty Russell (rusty@au1.ibm.com)
Tue, 06 May 2003 18:03:15 +1000


In message <20030506050744.GA29352@in.ibm.com> you write:
> On Mon, May 05, 2003 at 08:46:58AM +0000, Andrew Morton wrote:
> Andrew,
> Here is a comparision of kmalloc_percpu techniques as I see it,
>
> Current Implementation:
> 1. Two dereferences to get to the per-cpu data
> 2. Allocates for cpu_possible cpus only, and can deal with sparse cpu nos
>
> Rusty's Implementation
> 1. One extra memory reference (__per_cpu_offset)
> 2. allocates for NR_CPUS and probably breaks with sparse cpu nos?
> 3. Let you do per-cpu data in modules
> 4. fragmentation

And #3 is, in fact, the one I care about. The extra memory reference
is already probably cachehot (all static per-cpu use it), and might be
in a register on some archs.

Doesn't break with sparce CPU #s, but yes, it is inefficient.

Cheers,
Rusty.

--
  Anyone who quotes me in their sig is an idiot. -- Rusty Russell.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/