Re: [Qemu-devel] [PATCH 07/15] memory: avoid ref/unref in memory_region_find

2015-01-26 Thread Paolo Bonzini
On 26/01/2015 07:24, Fam Zheng wrote: >> > Do the entire lookup under RCU, which avoids atomic operations. > address_space_get_flatview() already is RCU protected, I don't see why this > patch is necessary. Could you explain? It's just an optimization; flatview_ref/flatview_unref do atomic_inc/a

Re: [Qemu-devel] [PATCH 07/15] memory: avoid ref/unref in memory_region_find

2015-01-25 Thread Fam Zheng
On Thu, 01/22 15:47, Paolo Bonzini wrote: > Do the entire lookup under RCU, which avoids atomic operations. address_space_get_flatview() already is RCU protected, I don't see why this patch is necessary. Could you explain? And there is one question below: > > Signed-off-by: Paolo Bonzini > ---

[Qemu-devel] [PATCH 07/15] memory: avoid ref/unref in memory_region_find

2015-01-22 Thread Paolo Bonzini
Do the entire lookup under RCU, which avoids atomic operations. Signed-off-by: Paolo Bonzini --- memory.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/memory.c b/memory.c index a844ced..577e87c 100644 --- a/memory.c +++ b/memory.c @@ -1828,7 +1828,8 @@ MemoryRegionSec