Re: [patch, feature] nonlinear mappings, prefaulting support, 2.5.42-F8

David S. Miller
2002-10-14T12:45:00Z

- TLB flush avoidance: the MAP_FIXED overmapping of larger than 4K cache
units causes a TLB flush, greatly increasing the overhead of 'basic'
DB cache operations - both the direct overhead and the secondary costs
of repopulating the TLB cache are signifiant - and will only increase
with newer CPUs. remap_file_pages() uses the one-page invalidation
instruction, which does not destroy the TLB.

Maybe on your cpu.

We created the range tlb flushes so that architectures have a chance
of optimizing such operations when possible.

If that isn't happening for small numbers of pages on x86 currently,
that isn't justification for special casing it here in this non-linear
mappings code.

If someone does a remap of 1GB of address space, I sure want the
option of doing a full MM flush if that is cheaper on my platform.

Currently, this part smells of an x86 performance hack, which might
even be suboptimal on x86 for remapping of huge ranges.