[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: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [RFC v2 1/6] memory: get rid of memory_region_destructor_ram_from_ptr() |
Date: |
Mon, 08 Jun 2015 18:09:17 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 |
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. :)
Paolo
[Qemu-devel] [RFC v2 4/6] hostmem: return recreated MemoryRegion if current can't be reused, Igor Mammedov, 2015/06/08
[Qemu-devel] [RFC v2 3/6] memory: support unmapping of MemoryRegion mapped into HVA parent, Igor Mammedov, 2015/06/08