[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 2/5] hostmem: make hostmem global and RAM hotunp
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH 2/5] hostmem: make hostmem global and RAM hotunplg safe |
Date: |
Fri, 12 Apr 2013 12:03:40 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130311 Thunderbird/17.0.4 |
Il 12/04/2013 10:38, Stefan Hajnoczi ha scritto:
>> > Yes, protect. Supposed we have HostMem A, and it will become B. Then
>> > hostmem_lookup will either see A or B. If it see A, it should use A
>> > refcnt agaist hostmem_listener_commit to drop A. This refcnt has no
>> > relation with mr's object's refcnt.
> My question is why you are accessing cur_hostmem outside hostmem_lock
> but then assigning it inside the lock on the next line...
>
>>>> > >> + cur_hostmem = next_hostmem;
> ...here.
>
> If you want an atomic exchange then tmp = cur_hostmem should be inside
> the lock.
It will work because readers will grab either the hostmem_lock or the
BQL, while writers will grab both. A kind of local/global lock, but I'm
not sure it was intentional. :) It's simpler to just move the read
inside the lock.
Paolo
- Re: [Qemu-devel] [PATCH 1/5] memory: add ref/unref interface for MemroyRegionOps, (continued)
- [Qemu-devel] [PATCH 2/5] hostmem: make hostmem global and RAM hotunplg safe, Liu Ping Fan, 2013/04/01
- Re: [Qemu-devel] [PATCH 2/5] hostmem: make hostmem global and RAM hotunplg safe, Stefan Hajnoczi, 2013/04/11
- Re: [Qemu-devel] [PATCH 2/5] hostmem: make hostmem global and RAM hotunplg safe, Paolo Bonzini, 2013/04/11
- Re: [Qemu-devel] [PATCH 2/5] hostmem: make hostmem global and RAM hotunplg safe, liu ping fan, 2013/04/11
- Re: [Qemu-devel] [PATCH 2/5] hostmem: make hostmem global and RAM hotunplg safe, Stefan Hajnoczi, 2013/04/12
- Re: [Qemu-devel] [PATCH 2/5] hostmem: make hostmem global and RAM hotunplg safe,
Paolo Bonzini <=
- Re: [Qemu-devel] [PATCH 2/5] hostmem: make hostmem global and RAM hotunplg safe, liu ping fan, 2013/04/14
- Re: [Qemu-devel] [PATCH 2/5] hostmem: make hostmem global and RAM hotunplg safe, Paolo Bonzini, 2013/04/15
[Qemu-devel] [PATCH 3/5] vring: use hostmem's RAM safe api, Liu Ping Fan, 2013/04/01
[Qemu-devel] [PATCH 4/5] virtio-blk: release reference to RAM's memoryRegion, Liu Ping Fan, 2013/04/01