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

From: Jeremy Fitzhardinge
Date: Thu Jul 10 2008 - 16:55:19 EST


Eric W. Biederman wrote:
Jeremy Fitzhardinge <jeremy@xxxxxxxx> writes:

No, that sounds like a bad idea. For one, how would you enforce it? How would
you check for it? It's one of those things that would mostly work and then fail
very rarely.

Well the easiest way would be to avoid the letting people take the address of
per cpu memory, and just provide macros to read/write it. We are 90% of the
way there already so it isn't a big jump.

Well, the x86_X_percpu api is there. But per_cpu() and get_cpu_var() both explicitly return lvalues which can have their addresses taken.

Secondly, I depend on it. I register a percpu structure with Xen to share
per-vcpu specific information (interrupt mask, time info, runstate stats, etc).

Well even virtual allocation is likely to break the Xen sharing case as you
would at least need to compute the physical address and pass it to Xen.

Right. At the moment it assumes that the percpu variable is in the linear mapping, but it could easily do a pagetable walk if necessary.

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/