Re: [patch] tlb flush_data: replace per_cpu with an array

From: Ingo Molnar
Date: Mon Jan 12 2009 - 16:47:13 EST



* Frederik Deweerdt <frederik.deweerdt@xxxxxxxx> wrote:

> Hi,
>
> On x86_64 flush tlb data is stored in per_cpu variables. This is
> unnecessary because only the first NUM_INVALIDATE_TLB_VECTORS entries
> are accessed.
>
> This patch aims at making the code less confusing (there's nothing
> really "per_cpu") by using a plain array. It also would save some memory
> on most distros out there (Ubuntu x86_64 has NR_CPUS=64 by default).

indeed, well spotted!

This construct was indeed an abuse of the per_cpu facilities.

Note that beyond the obvious memory savings, your patch should make the
code a bit faster and a bit smaller as well in the SMP TLB flush codepath:
the smp_flush_state data structure is 64 (or 128) bytes so static array
arithmetics will be faster than the per_cpu indirection.

I have applied your patch to tip/x86/mm, thanks Frederik!

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