Re: [PATCHSET x86/core/percpu] implement dynamic percpu allocator

From: Ingo Molnar
Date: Mon Feb 23 2009 - 05:18:19 EST



* Tejun Heo <tj@xxxxxxxxxx> wrote:

> Hello, Ingo.
>
> Ingo Molnar wrote:
> > Heck no. It is absolutely crazy to complicate __pa()/__va() in
> > _any_ way just to 'save' one more 2MB dTLB.
>
> Are __pa()/__va() that hot paths? Or am I over-estimating the
> cost of 2MB dTLB?

yes, __pa()/__va() is a very hot path - in a defconfig they are
used in about a thousand different places.

In fact it would be nice to get rid of the __phys_addr()
redirection on the 64-bit side (which is non-linear and a
function there, and all __pa()s go through it) and make it a
constant offset again.

This isnt trivial/possible to do though as .data/.bss is in the
high alias. (high .text aliases alone wouldnt be a big issue to
fix, but the data aliases are an issue.)

Moving .data/.bss into the linear space isnt feasible as we'd
lose RIP-relative addressing shortcuts.

Maybe we could figure out the places that do __pa() on a high
alias and gradually eliminate them. __pa() on .data/.bss is a
rare and unusal thing to do, and CONFIG_DEBUG_VIRTUAL could warn
about them without crashing the kernel.

Later on we could make this check unconditional, and then switch
over __pa() to addr-PAGE_OFFSET in the !CONFIG_DEBUG_VIRTUAL
case (which is the default).

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