Re: linux-next: percpu tree build warning

Tejun Heo
2009-11-25T12:32:26Z

Hello,

11/25/2009 07:50 PM, Ingo Molnar wrote:
> Tejun, is it perhaps a problem of the percpu code getting confused
> between the local and file scope 'dr7' variable shadowing each other?

Yes.

> If yes then that needs to be fixed in the percpu tree. per-cpu variables
> used to have a __per_cpu prefix and that should be maintained - the two
> namespaces are obviously separate on the logical space, so they should
> never overlap in the implementational space either.

If all we ever have are static variables, the prefix may be fine but
with dynamic percpu variables now basically being the same first class
citizen but prefix just doesn't cut it. It just ends up adding more
confusion. The transition will be a bit painful (but not too much,
how many of these reports have we had? Only several) but after that
it's just plain local/global symbol collision the compiler would have
no problem warning about. It behaves exactly like other global
symbols.

Percpu symbols and variables belong to a different address space than
normal symbols. Unfortunately, C doesn't have support for such thing.
Prefixing kind of works but simply breaks when the addresses are
allowed to be handled as values. We have had the exactly same problem
and solution for years now - iomem. Percpu memory isn't different
from iomem at all. Once the conversion is complete and annotations
and code are upstream, it won't be painful at all.

Thanks.

--
tejun