Re: [RFC 00/15] x86_64: Optimize percpu accesses

From: Jeremy Fitzhardinge
Date: Wed Jul 09 2008 - 17:24:45 EST


Ingo Molnar wrote:
* Mike Travis <travis@xxxxxxx> wrote:

This fragility makes me very nervous. It seems hard enough to get this stuff working with current tools; making it work over the whole range of supported tools looks like its going to be hard.
(me too ;-)

Once I get a solid version working with (at least) gcc-4.2.4, then regression testing with older tools will be easier, or at least a table of results can be produced.

the problem is, we cannot just put it even into tip/master if there's no short-term hope of fixing a problem it triggers. gcc-4.2.3 is solid for me otherwise, for series of thousands of randomly built kernels.

can we just leave out the zero-based percpu stuff safely and could i test the rest of your series - or are there dependencies? I think zero-based percpu, while nice in theory, is probably just a very small positive effect so it's not a life or death issue. (or is there any deeper, semantic reason why we'd want it?)

I'm looking forward to using it, because I can make the Xen vcpu structure a percpu variable shared with the hypervisor. This means something like a disable interrupt becomes a simple "movb $1,%gs:per_cpu__xen_vcpu_event_mask". If access to percpu variables is indirect (ie, two instructions) I need to disable preemption which makes the whole thing much more complex, and too big to inline. There are other cases where preemption-safe access to percpu variables is useful as well.

My view, which is admittedly very one-sided, is that all this brokenness is forced on us by gcc's stack-protector brokenness. My preferred approach would be to fix -fstack-protector by eliminating the requirement for small offsets from %gs. With that in place we could support it without needing a pda. In the meantime, we could either support stack-protector or direct access to percpu variables. Either way, we don't need to worry about making zero-based percpu work.

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