Re: per_cpu fixes

David Mosberger (davidm@napali.hpl.hp.com)
Thu, 10 Jul 2003 11:22:05 -0700


>>>>> On Thu, 10 Jul 2003 11:15:25 -0700 (PDT), Linus Torvalds <torvalds@osdl.org> said:

Linus> On Thu, 10 Jul 2003, David Mosberger wrote:
>>
>> You mean there would be three primitives:
>>
>> (1) get value from a per-CPU variable
>> (2) set value of a per-CPU variable
>> (3) get the (canonical) address of a per-CPU variable

Linus> Argh.

Linus> We'd better have the rule that if there are any virtual
Linus> caches or other issues, then the "canonical address" had
Linus> better be the _only_ address (or at least any virtual
Linus> remapping has to be done in such a way that it never causes
Linus> aliasing or other performance problems with the canonical
Linus> address).

Linus> This is already turning fairly ugly, and I just don't want to
Linus> see even more ugly rules like "you can't mix direct accesses
Linus> with pointer accesses"

Yes, Rusty's proposal (as I think I summarized above) would do exactly
that: the only address that you'll ever see for a per-CPU variable
will be the canonical one. The get/set macros can use an alias on
platforms where this is more efficient, but the alias will never be
visible outside the macros.

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