Re: [PATCH 1/1] x86/vmemmap: Use direct-mapped VA instead of vmemmap-based VA

From: Dave Hansen
Date: Thu Mar 06 2025 - 11:09:41 EST


On 3/5/25 19:46, Andrew Morton wrote:
> Can we please have review from x86 maintainers?

I didn't respond here because I thought this was the same problem from
the same contributor that we addressed in another thread:

> https://lore.kernel.org/all/d1da214c-53d3-45ac-a8b6-51821c5416e4@xxxxxxxxx/

I think this approach is a hack. It basically requires that every bit of
code that _might_ update (and then use) a PGD in the init_mm know how to
find the direct map alias and then use that instead. This would further
specialize the x86 code. I have no reason to believe that this is truly
an x86-specific problem. Are we really the only arch that has a
per-process PGD that maps the shared kernel page tables?

The right solution (like I mentioned in the other thread) is to sync the
PGDs more aggressively. Syncing them is expensive, of course, but it's a
pretty darn rare operation.