Re: Comments on UV tlb flushing

From: Jeremy Fitzhardinge
Date: Tue Jul 29 2008 - 02:26:41 EST


Nick Piggin wrote:
2. CONFIG_X86_UV should either depend on or select CONFIG_PARAVIRT.
3. You should hook into paravirt_ops to enable your tlb-flush code.
That is, in - say - uv_bau_init() you do
"pv_mmu_ops.flush_tlb_others = uv_flush_tlb_others". This removes
a test/branch in the generic code. Using paravirt_ops may open
other opportunities to put UV-optimised functions in place without
having to modify generic code.

Really? It's not virtualized at all, although I don't like adding that
branch for such a small class of systems either.

It's not virtualized, but paravirt_ops provides a wide range of low-level hooks into all kinds of useful things; we may as well use them if they're there. It's similar to VSMP's use of pvops: they do something odd with shadowing the interrupt flag in AC in flags, and hook irq_enable/disable/save/restore to implement it.

It would possibly be better to have a new function (eg.
override_flush_tlb_others()), which returns 0 if
CONFIG_OVERRIDE_FLUSH_TLB is set, otherwise branches. And have *that*
selected by CONFIG_PARAVIRT and X86_UV.

There doesn't seem much point. CONFIG_PARAVIRT will turn all the flush_tlb_others() into indirect calls which can be hooked, then the paravirt patching machinery will turn them back into direct calls. So it basically gives you the flexibility of pluggin in arbitrary functions, but with zero runtime overhead.

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