Re: [GIT RFC] percpu: use dynamic percpu allocator as the defaultpercpu allocator

From: Martin Schwidefsky
Date: Wed Apr 01 2009 - 04:11:33 EST


On Wed, 01 Apr 2009 09:07:41 +0900
Tejun Heo <tj@xxxxxxxxxx> wrote:

> Martin Schwidefsky wrote:
> >
> > I got the dynamic cpu allocator to work with the patch below. Anybody
> > with an objection against the SHIFT_PERCPU_VAR macro ?
>
> One of the main goals of the percpu allocator is removing the
> distinction between statically and dynamically allocated percpu
> variables, so that it can be treated like other normal variables. For
> all archs other than s390, alpha and ia64, achieving this is easy, so
> I wish we could come up with solution for the three archs too. Is it
> possible to do similar stuff with pointer values with input
> constraint which can take both constant and variable?

Is the goal to use the same access macros for both dynamically and
statically allocated percpu variables? That would make the proposed
solution impractical.

The "X" constraint trick we used so far tells the compiler to pass the
argument verbatim to the assembler. The assembler knows how to deal
with symbol@GOTENT. If we pass a gcc variable or even a more general
term via an "X" constraint the assembler gets <something C-ish>@GOTENT.
It is not possible to parse this in the assembler. To do what you want
to achieve would mean to avoid using the "X" constraint. Which means
that we cannot use the GOTENT trick anymore. If we let the compiler
resolve the address for a static per cpu variable we end up with the
larl problem. Ouch!

So far the SHIFT_PERCPU_PTR/SHIFT_PERCPU_VAR is the only solution
I have found for s390 and the dynamic percpu allocator. I'll keep
looking for a better solution but I am not optimistic.

--
blue skies,
Martin.

"Reality continues to ruin my life." - Calvin.

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