On Mon, 08 Jun 2015 18:09:17 +0200 Paolo Bonzini <pbonz...@redhat.com> wrote:
> > > On 08/06/2015 18:08, Igor Mammedov wrote: > > On Mon, 08 Jun 2015 17:23:35 +0200 > > Paolo Bonzini <pbonz...@redhat.com> wrote: > > > >> > >> > >> On 08/06/2015 17:19, Igor Mammedov wrote: > >>> - qemu_mutex_lock_ramlist(); > >>> - QLIST_FOREACH_RCU(block, &ram_list.blocks, next) { > >>> - if (addr == block->offset) { > >>> - QLIST_REMOVE_RCU(block, next); > >>> - ram_list.mru_block = NULL; > >>> - /* Write list before version */ > >>> - smp_wmb(); > >>> - ram_list.version++; > >>> - g_free_rcu(block, rcu); > >> > >> qemu_ram_free here does: > >> > >> call_rcu(block, reclaim_ramblock, rcu); > >> > >> which is different. > > > > > > qemu_ram_free() calls reclaim_ramblock() which does: > > > > if (!(block->flags & RAM_PREALLOC)) > > free_host_memory() > > > > g_free(block) > > > > while > > g_free_rcu(block, rcu) results -> g_free(block) > > > > and for memory_region_init_ram_ptr() we set RAM_PREALLOC > > so qemu_ram_free() degrades to g_free(block). > > Please put this in the commit message. :) ok, I'll post it as separate cleanup patch as it doesn't depend on the rest of series. > > Paolo