Re: [PATCH] 2.5.1-pre5: per-cpu areas

Andi Kleen (ak@suse.de)
Thu, 14 Mar 2002 12:14:56 +0100


On Thu, Mar 14, 2002 at 10:09:52PM +1100, Rusty Russell wrote:
> Sorry, I think one macro to get the address, one to get the contents
> is a *horrible* interface. per_cpu() and per_cpu_ptr() or something?

It is not pretty, but I have no choice. See include/asm-x86_64/pda.h on what I
have currently. Supporting the address in the same macro would
double to overhead of accesing it.

> I think you'll find that per_cpu_ptr would be fairly common, so we're
> forced into a bad interface for little gain. You might be better off
> using another method to implement per-cpu areas.

Nope, the segment register has to stay for other reasons, and it would
be a shame to not use it for cpu data too.

I don't see it as that bad. Is it really that difficult to write _ptr
if you want the address? You can also write _noptr or _direct or whatever
if you don't want the address if you prefer that, but I want to keep
the option to do direct access even for generic code.

-Andi
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/