Re: [PATCH 2/4] generic-smp: remove kmalloc usage

Linus Torvalds
2009-02-19T16:54:44Z

On Thu, 19 Feb 2009, Rusty Russell wrote:
>
> So if we care about the kmalloc, why didn't we see benchmarks when we
> switched from the x86 smp_call_function_mask to the generic one? Or did
> I just miss them (there's nothing in the git commit).

I don't think we care about kmalloc from a performance angle. Sure, it's
nice if we can make IPI's be really low cost, and we should aim for that,
but the reason the kmalloc() was added was never performance - nor is that
the reason we now try to remove it.

The kmalloc() was added for correctness reasons, and we now try to remove
it to make the code look saner and simpler (and hopefully it gets faster
too, but I don't think that was ever a primary issue), since we ended up
having _three_ different cases for the whole insane memory allocation
(on-stack, per-cpu and kmalloc), and nobody sane really wants that.

Linus