Re: [PATCH 07/12] KVM: MMU: redesign the algorithm of pte_list

2013-08-28 Thread Xiao Guangrong
On 08/28/2013 04:58 PM, Gleb Natapov wrote: > On Wed, Aug 28, 2013 at 04:37:32PM +0800, Xiao Guangrong wrote: >> On 08/28/2013 04:12 PM, Gleb Natapov wrote: >> + + rmap_printk("pte_list_add: %p %llx many->many\n", spte, *spte); + desc = (struct pte_list_desc *)(*pte_list & ~1ul);

Re: [PATCH 07/12] KVM: MMU: redesign the algorithm of pte_list

2013-08-28 Thread Gleb Natapov
On Wed, Aug 28, 2013 at 04:37:32PM +0800, Xiao Guangrong wrote: > On 08/28/2013 04:12 PM, Gleb Natapov wrote: > > >> + > >> + rmap_printk("pte_list_add: %p %llx many->many\n", spte, *spte); > >> + desc = (struct pte_list_desc *)(*pte_list & ~1ul); > >> + > >> + /* No empty position in the

Re: [PATCH 07/12] KVM: MMU: redesign the algorithm of pte_list

2013-08-28 Thread Xiao Guangrong
On 08/28/2013 04:12 PM, Gleb Natapov wrote: >> + >> +rmap_printk("pte_list_add: %p %llx many->many\n", spte, *spte); >> +desc = (struct pte_list_desc *)(*pte_list & ~1ul); >> + >> +/* No empty position in the desc. */ >> +if (desc->sptes[PTE_LIST_EXT - 1]) { >> +struct

Re: [PATCH 07/12] KVM: MMU: redesign the algorithm of pte_list

2013-08-28 Thread Gleb Natapov
On Tue, Jul 30, 2013 at 09:02:05PM +0800, Xiao Guangrong wrote: > Change the algorithm to: > 1) always add new desc to the first desc (pointed by parent_ptes/rmap) >that is good to implement rcu-nulls-list-like lockless rmap >walking > > 2) always move the entry in first desc to the the

Re: [PATCH 07/12] KVM: MMU: redesign the algorithm of pte_list

2013-08-28 Thread Gleb Natapov
On Tue, Jul 30, 2013 at 09:02:05PM +0800, Xiao Guangrong wrote: Change the algorithm to: 1) always add new desc to the first desc (pointed by parent_ptes/rmap) that is good to implement rcu-nulls-list-like lockless rmap walking 2) always move the entry in first desc to the the

Re: [PATCH 07/12] KVM: MMU: redesign the algorithm of pte_list

2013-08-28 Thread Xiao Guangrong
On 08/28/2013 04:12 PM, Gleb Natapov wrote: + +rmap_printk(pte_list_add: %p %llx many-many\n, spte, *spte); +desc = (struct pte_list_desc *)(*pte_list ~1ul); + +/* No empty position in the desc. */ +if (desc-sptes[PTE_LIST_EXT - 1]) { +struct pte_list_desc

Re: [PATCH 07/12] KVM: MMU: redesign the algorithm of pte_list

2013-08-28 Thread Gleb Natapov
On Wed, Aug 28, 2013 at 04:37:32PM +0800, Xiao Guangrong wrote: On 08/28/2013 04:12 PM, Gleb Natapov wrote: + + rmap_printk(pte_list_add: %p %llx many-many\n, spte, *spte); + desc = (struct pte_list_desc *)(*pte_list ~1ul); + + /* No empty position in the desc. */ + if

Re: [PATCH 07/12] KVM: MMU: redesign the algorithm of pte_list

2013-08-28 Thread Xiao Guangrong
On 08/28/2013 04:58 PM, Gleb Natapov wrote: On Wed, Aug 28, 2013 at 04:37:32PM +0800, Xiao Guangrong wrote: On 08/28/2013 04:12 PM, Gleb Natapov wrote: + + rmap_printk(pte_list_add: %p %llx many-many\n, spte, *spte); + desc = (struct pte_list_desc *)(*pte_list ~1ul); + + /* No empty

[PATCH 07/12] KVM: MMU: redesign the algorithm of pte_list

2013-07-30 Thread Xiao Guangrong
Change the algorithm to: 1) always add new desc to the first desc (pointed by parent_ptes/rmap) that is good to implement rcu-nulls-list-like lockless rmap walking 2) always move the entry in first desc to the the position we want to remove when remove a spte in the parent_ptes/rmap

[PATCH 07/12] KVM: MMU: redesign the algorithm of pte_list

2013-07-30 Thread Xiao Guangrong
Change the algorithm to: 1) always add new desc to the first desc (pointed by parent_ptes/rmap) that is good to implement rcu-nulls-list-like lockless rmap walking 2) always move the entry in first desc to the the position we want to remove when remove a spte in the parent_ptes/rmap