Re: [Qemu-devel] [RFC PATCH 1/2] mem: make phys_section and phys_map_nodes prepared for RCU

2013-05-28 Thread liu ping fan
On Mon, May 27, 2013 at 7:54 PM, Paolo Bonzini wrote: > Il 26/05/2013 15:02, liu ping fan ha scritto: >> [...] >> +static PhysPageTable *cur_pgtbl; >> +static PhysPageTable *next_pgtbl; > > You shouldn't need cur_pgtbl. Instead, each AddressSpaceDispatch should > have a pointe

Re: [Qemu-devel] [RFC PATCH 1/2] mem: make phys_section and phys_map_nodes prepared for RCU

2013-05-27 Thread Paolo Bonzini
Il 26/05/2013 15:02, liu ping fan ha scritto: > [...] > +static PhysPageTable *cur_pgtbl; > +static PhysPageTable *next_pgtbl; You shouldn't need cur_pgtbl. Instead, each AddressSpaceDispatch should have a pointer to its own cur_pgtbl. In the commit hook you can then t

Re: [Qemu-devel] [RFC PATCH 1/2] mem: make phys_section and phys_map_nodes prepared for RCU

2013-05-26 Thread liu ping fan
[...] +static PhysPageTable *cur_pgtbl; +static PhysPageTable *next_pgtbl; >>> >>> You shouldn't need cur_pgtbl. Instead, each AddressSpaceDispatch should >>> have a pointer to its own cur_pgtbl. In the commit hook you can then >>> take a lock, unref the old table, assign cur_pgtbl = ne

Re: [Qemu-devel] [RFC PATCH 1/2] mem: make phys_section and phys_map_nodes prepared for RCU

2013-05-15 Thread liu ping fan
On Tue, May 14, 2013 at 5:27 PM, Paolo Bonzini wrote: > Il 14/05/2013 05:38, liu ping fan ha scritto: +struct PhysPageTable { +int ref; +PhysSection *phys_sections; +unsigned phys_sections_nb; +unsigned phys_sections_nb_alloc; +uint16_t phys_sectio

Re: [Qemu-devel] [RFC PATCH 1/2] mem: make phys_section and phys_map_nodes prepared for RCU

2013-05-14 Thread Paolo Bonzini
Il 14/05/2013 05:38, liu ping fan ha scritto: >>> +struct PhysPageTable { >>> +int ref; >>> +PhysSection *phys_sections; >>> +unsigned phys_sections_nb; >>> +unsigned phys_sections_nb_alloc; >>> +uint16_t phys_section_unassigned; >>> +uint16_t phys_section_notdirty; >>> +

Re: [Qemu-devel] [RFC PATCH 1/2] mem: make phys_section and phys_map_nodes prepared for RCU

2013-05-13 Thread liu ping fan
On Mon, May 13, 2013 at 5:20 PM, Paolo Bonzini wrote: > Il 13/05/2013 05:21, Liu Ping Fan ha scritto: >> From: Liu Ping Fan >> >> Now, each AddressSpaceDispatch has its own radix-tree, and all of them >> lie on phys_section[] and phys_map_nodes[]. When we want lockless >> mmio dispatch, we need s

Re: [Qemu-devel] [RFC PATCH 1/2] mem: make phys_section and phys_map_nodes prepared for RCU

2013-05-13 Thread Paolo Bonzini
Il 13/05/2013 05:21, Liu Ping Fan ha scritto: > From: Liu Ping Fan > > Now, each AddressSpaceDispatch has its own radix-tree, and all of them > lie on phys_section[] and phys_map_nodes[]. When we want lockless > mmio dispatch, we need something like RCU. > > Acheive this with PhysPageTable which

[Qemu-devel] [RFC PATCH 1/2] mem: make phys_section and phys_map_nodes prepared for RCU

2013-05-12 Thread Liu Ping Fan
From: Liu Ping Fan Now, each AddressSpaceDispatch has its own radix-tree, and all of them lie on phys_section[] and phys_map_nodes[]. When we want lockless mmio dispatch, we need something like RCU. Acheive this with PhysPageTable which contains all of the info for all radix trees. After all add