Re: [RFC] respect the referenced bit of KVM guest pages?
From: Rik van Riel
Date: Wed Aug 05 2009 - 11:16:18 EST
Avi Kivity wrote:
If so, we could unmap them when they get moved from the
active to the inactive list, and soft fault them back in
on access, emulating the referenced bit for EPT pages and
making page replacement on them work like it should.
It should be easy to implement via the mmu notifier callback: when the
mm calls clear_flush_young(), mark it as young, and unmap it from the
EPT pagetable.
You mean "mark it as old"?
Your approximation of pretending the page is accessed the
first time and pretending it's not the second time sounds
like it will just lead to less efficient FIFO replacement,
not to anything even vaguely approximating LRU.
Right, it's just a hack that gives EPT pages higher priority, like the
original patch suggested. Note that LRU for VMs is not a good
algorithm, since the VM will also reference the least recently used
page, leading to thrashing.
That is one of the reasons we use a very coarse two
handed clock algorithm instead of true LRU.
LRU has more overhead and more artifacts :)
--
All rights reversed.
--
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/