[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 02/15] memory: add ref/unref
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH 02/15] memory: add ref/unref |
Date: |
Mon, 03 Jun 2013 08:49:10 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130514 Thunderbird/17.0.6 |
Il 02/06/2013 17:58, Peter Maydell ha scritto:
>> > + * memory_region_ref: Add 1 to a memory region's reference count
>> > + *
>> > + * Whenever memory regions are accessed outside the BQL, they need to be
>> > + * preserved against hot-unplug. MemoryRegions actually do not have their
>> > + * own reference count; they piggyback on a QOM object, their "owner".
>> > + * This function adds a reference to the owner.
> It doesn't make much sense to describe the function as
> "add 1 to a memory region's reference count" and then
> say that memory regions don't have reference counts...
The fact that the reference count is the owner's is really an
implementation detail. The reference count is used entirely as if it
were the region's.
So the summary says it is the region's, the long description says what
happens under the hood.
Suggestions on rephrasing the comments are welcome.
Paolo
- [Qemu-devel] [PATCH 00/15] Memory/IOMMU patches part 4: region ownership, Paolo Bonzini, 2013/06/02
- [Qemu-devel] [PATCH 01/15] memory: add getter/setter for owner, Paolo Bonzini, 2013/06/02
- [Qemu-devel] [PATCH 02/15] memory: add ref/unref, Paolo Bonzini, 2013/06/02
- [Qemu-devel] [PATCH 04/15] exec: add a reference to the region returned by address_space_translate, Paolo Bonzini, 2013/06/02
- [Qemu-devel] [PATCH 03/15] memory: add ref/unref calls, Paolo Bonzini, 2013/06/02
- [Qemu-devel] [PATCH 05/15] pci: set owner for BARs, Paolo Bonzini, 2013/06/02
- [Qemu-devel] [PATCH 06/15] sysbus: set owner for MMIO regions, Paolo Bonzini, 2013/06/02
- [Qemu-devel] [PATCH 07/15] acpi: add memory_region_set_owner calls, Paolo Bonzini, 2013/06/02
- [Qemu-devel] [PATCH 08/15] misc: add memory_region_set_owner calls, Paolo Bonzini, 2013/06/02
- [Qemu-devel] [PATCH 09/15] isa/portio: allow setting an owner, Paolo Bonzini, 2013/06/02
- [Qemu-devel] [PATCH 10/15] vga: add memory_region_set_owner calls, Paolo Bonzini, 2013/06/02
- [Qemu-devel] [PATCH 11/15] pci-assign: add memory_region_set_owner calls, Paolo Bonzini, 2013/06/02
- [Qemu-devel] [PATCH 12/15] vfio: add memory_region_set_owner calls, Paolo Bonzini, 2013/06/02