Re: [PATCH 5/7] Use %gs for per-cpu sections in kernel

From: Andi Kleen
Date: Sat Sep 23 2006 - 04:18:26 EST


> Mainly that it makes more sense to use the existing per-cpu concept than
> introduce another kind of per-cpu var within a special structure, but
> it's also more efficient (see other post). Hopefully it will spark

What post exactly? AFAIK it is the same code for common code.

The advantage of the PDA split is that the important variables which are
in the PDA can be accessed with a single reference, while generic portable
per CPU data is the same as it was before. With your scheme even
the PDA accesses are at least two instructions, right? (I don't
think gcc/ld can resolve the per cpu section offset into a constant,
so it has to load them into a register first)

> interest in making dynamic-percpu pointers use the same offset scheme,
> now x86 will experience the benefits.
>
> And we might even get a third user of local_t!

I'm not holding my breath. I guess it was a nice idea before preemption
became popular ...

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