Re: swapping with MMU Notifiers V2

Andrea Arcangeli
2008-01-29T18:42:12Z

On Tue, Jan 29, 2008 at 07:19:18PM +0100, Joerg Roedel wrote:
> Since NPT uses the host page table format it is in theory possible to
> add the pagetable to the Linux MM rmap. In this case it would not be
> necessary to use MMU notifiers. But I think this would complicate the
> NPT support code significantly.

The Linux rmap isn't like Christoph's secondary-rmap, nor similar to
the KVM rmap. The difference is that the linux rmap requires zero ram
in rmap structures, for each new page allocated by a linux page
fault. While KVM rmap requires a few bytes for each new page allocated
with get_user_pages and mapped/cached in some spte. So we can't
represent NTP pagetables in linux rmap and the current mmu notifier
model is quite optimal for it.

What instead may be possible with NTP given the radix tree format, is
to make a KVM rmap implementation for NPT similar to the one in the
linux VM, to avoid losing 64bit of ram for each new NPT pagetable
allocated and mapped, so the mmu notifier may be able to reverse from
host virtual to NPT pagetable without having to use any metadata but
by just walking the NPT tree for the VM. I'm not sure if it's feasible
though.