Re: [PATCH] kvm cleanup: Introduce sibling_pte and do cleanup for reverse map and parent_pte

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Avi Kivity
Date: Monday, August 2, 2010 - 11:51 pm

On 08/03/2010 05:30 AM, Lai Jiangshan wrote:

That is the case with NPT and EPT.  Each page has exactly one spte 
(except a few vga pages), and each sp has exactly one parent_pte (except 
the root pages).


The existing rmap_next() is not O(N), it's O(RMAP_EXT), which is 4.  The 
data structure was chosen over a simple linked list to avoid extra cache 
misses.


kvm_rmap_desc and kvm_pte_chain are indeed ugly, but they do save a lot 
of memory and cache misses.


I agree the new code is more readable.  Unfortunately it uses more 
memory and is likely to be slower.  You add a cache miss for every spte, 
while kvm_rmap_desc amortizes the cache miss among 4 sptes, and special 
cases 1 spte to have no cache misses (or extra memory requirements).

-- 
I have a truly marvellous patch that fixes the bug which this
signature is too narrow to contain.

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH] kvm cleanup: Introduce sibling_pte and do clea ..., Avi Kivity, (Mon Aug 2, 11:51 pm)