On Jun 15, 2017 7:48 AM, "Andy Lutomirski" <luto@xxxxxxxxxx> wrote:
Then throw EPT into the mix for extra fun. I wonder if we should try
to allocate page tables from nearby physical addresses if we think we
might be running as a guest.
They are already dense in the cache in the last level, and upper levels are already fairly dense if you are just *reasonably* dense in your virtual mapping.
Yes, for virtualization, the "virtual mapping" ends up being those page tables, but physical memory itself is already fairly 'reasonably dense' to begin with. One single cache line of any upper level page table will cover quite a bit of memory.
You're likely better off just trying to use large pages for the virtual machine memory layout, which helps in other ways too. But when that fails,I doubt it helps a lot to try to do fancy page table layout.
All gut feelings, but i seriously doubt any extra complexity would be a win big enough to make up for the complexity costs..
Linus