qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [RFC v2 1/6] memory: get rid of memory_region_destructo


From: Igor Mammedov
Subject: Re: [Qemu-devel] [RFC v2 1/6] memory: get rid of memory_region_destructor_ram_from_ptr()
Date: Mon, 8 Jun 2015 18:26:56 +0200

On Mon, 08 Jun 2015 18:09:17 +0200
Paolo Bonzini <address@hidden> wrote:

> 
> 
> On 08/06/2015 18:08, Igor Mammedov wrote:
> > On Mon, 08 Jun 2015 17:23:35 +0200
> > Paolo Bonzini <address@hidden> 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]