[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 5/9] memory: Refer to docs/devel/memory.rst for "owner"
From: |
Akihiko Odaki |
Subject: |
[PATCH v3 5/9] memory: Refer to docs/devel/memory.rst for "owner" |
Date: |
Mon, 08 Jul 2024 15:55:16 +0900 |
memory_region_ref() and memory_region_unref() used to have their own
descriptions of "owner", but they are somewhat out-of-date and
misleading.
In particular, they say "whenever memory regions are accessed outside
the BQL, they need to be preserved against hot-unplug", but protecting
against hot-unplug is not mandatory if it is known that they will never
be hot-unplugged. They also say "MemoryRegions actually do not have
their own reference count", but they actually do. They just will not be
used unless their owners are not themselves.
Refer to docs/devel/memory.rst as the single source of truth instead of
maintaining duplicate descriptions of "owner".
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
---
include/exec/memory.h | 13 ++-----------
1 file changed, 2 insertions(+), 11 deletions(-)
diff --git a/include/exec/memory.h b/include/exec/memory.h
index a5af05864274..e1bd29550c15 100644
--- a/include/exec/memory.h
+++ b/include/exec/memory.h
@@ -1245,15 +1245,8 @@ void memory_region_init(MemoryRegion *mr,
/**
* memory_region_ref: Add a reference to a memory region
*
- * 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.
- *
- * All MemoryRegions must have an owner if they can disappear, even if the
- * device they belong to operates exclusively under the BQL. This is because
- * the region could be returned at any time by memory_region_find, and this
- * is usually under guest control.
+ * See docs/devel/memory.rst to know about owner.
*
* @mr: the #MemoryRegion
*/
@@ -1262,10 +1255,8 @@ void memory_region_ref(MemoryRegion *mr);
/**
* memory_region_unref: Remove a reference to a memory region
*
- * 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 removes a reference to the owner and possibly destroys it.
+ * See docs/devel/memory.rst to know about owner.
*
* @mr: the #MemoryRegion
*/
--
2.45.2
- [PATCH v3 0/9] Fix check-qtest-ppc64 sanitizer errors, Akihiko Odaki, 2024/07/08
- [PATCH v3 1/9] spapr: Free stdout path, Akihiko Odaki, 2024/07/08
- [PATCH v3 2/9] ppc/vof: Fix unaligned FDT property access, Akihiko Odaki, 2024/07/08
- [PATCH v3 3/9] migration: Free removed SaveStateEntry, Akihiko Odaki, 2024/07/08
- [PATCH v3 4/9] memory: Do not refer to "memory region's reference count", Akihiko Odaki, 2024/07/08
- [PATCH v3 5/9] memory: Refer to docs/devel/memory.rst for "owner",
Akihiko Odaki <=
- [PATCH v3 6/9] memory: Clarify that owner may be missing, Akihiko Odaki, 2024/07/08
- [PATCH v3 8/9] memory: Do not create circular reference with subregion, Akihiko Odaki, 2024/07/08
- [PATCH v3 7/9] memory: Clarify owner must not call memory_region_ref(), Akihiko Odaki, 2024/07/08
- [PATCH v3 9/9] tests/qtest: Delete previous boot file, Akihiko Odaki, 2024/07/08