From: Peter Xu <peterx@redhat.com>
To: Akihiko Odaki <akihiko.odaki@daynix.com>
Cc: "Eduardo Habkost" <eduardo@habkost.net>,
"Marcel Apfelbaum" <marcel.apfelbaum@gmail.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Yanan Wang" <wangyanan55@huawei.com>,
"John Snow" <jsnow@redhat.com>,
"BALATON Zoltan" <balaton@eik.bme.hu>,
"Jiaxun Yang" <jiaxun.yang@flygoat.com>,
"Nicholas Piggin" <npiggin@gmail.com>,
"Daniel Henrique Barboza" <danielhb413@gmail.com>,
"David Gibson" <david@gibson.dropbear.id.au>,
"Harsh Prateek Bora" <harshpb@linux.ibm.com>,
"Alexey Kardashevskiy" <aik@ozlabs.ru>,
"Michael S. Tsirkin" <mst@redhat.com>,
"Alex Bennée" <alex.bennee@linaro.org>,
"Fabiano Rosas" <farosas@suse.de>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"David Hildenbrand" <david@redhat.com>,
"Thomas Huth" <thuth@redhat.com>,
"Laurent Vivier" <lvivier@redhat.com>,
"Peter Maydell" <peter.maydell@linaro.org>,
qemu-devel@nongnu.org, qemu-block@nongnu.org,
qemu-ppc@nongnu.org, devel@daynix.com
Subject: Re: [PATCH v7 2/2] memory: Do not create circular reference with subregion
Date: Thu, 9 Jan 2025 10:55:58 -0500 [thread overview]
Message-ID: <Z3_xjlqNyIJAQTYq@x1n> (raw)
In-Reply-To: <20250109-san-v7-2-93c432a73024@daynix.com>
On Thu, Jan 09, 2025 at 02:50:21PM +0900, Akihiko Odaki wrote:
> memory_region_update_container_subregions() used to call
> memory_region_ref(), which creates a reference to the owner of the
> subregion, on behalf of the owner of the container. This results in a
> circular reference if the subregion and container have the same owner.
>
> memory_region_ref() creates a reference to the owner instead of the
> memory region to match the lifetime of the owner and memory region. We
> do not need such a hack if the subregion and container have the same
> owner because the owner will be alive as long as the container is.
> Therefore, create a reference to the subregion itself instead ot its
> owner in such a case; the reference to the subregion is still necessary
> to ensure that the subregion gets finalized after the container.
>
> Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
--
Peter Xu
prev parent reply other threads:[~2025-01-09 15:56 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-09 5:50 [PATCH v7 0/2] Fix check-qtest-ppc64 sanitizer errors Akihiko Odaki
2025-01-09 5:50 ` [PATCH v7 1/2] memory: Update inline documentation Akihiko Odaki
2025-01-09 12:30 ` BALATON Zoltan
2025-01-09 19:29 ` Peter Xu
2025-01-09 19:37 ` Peter Xu
2025-01-10 8:43 ` Akihiko Odaki
2025-01-10 15:18 ` Peter Xu
2025-01-11 4:15 ` Akihiko Odaki
2025-01-13 15:57 ` Peter Xu
2025-01-14 8:43 ` Akihiko Odaki
2025-01-14 17:02 ` Peter Xu
2025-01-14 17:42 ` Peter Maydell
2025-01-14 19:12 ` Peter Xu
2025-01-16 14:50 ` Peter Maydell
2025-01-16 16:13 ` BALATON Zoltan
2025-01-17 6:19 ` Akihiko Odaki
2025-08-28 10:11 ` Peter Maydell
2025-08-28 13:17 ` Alex Bennée
2025-08-28 16:10 ` Peter Xu
2025-01-16 16:40 ` Peter Xu
2025-01-15 4:46 ` Akihiko Odaki
2025-01-15 13:43 ` Peter Xu
2025-01-15 14:54 ` Akihiko Odaki
2025-01-15 15:40 ` Peter Xu
2025-01-15 15:52 ` Akihiko Odaki
2025-01-15 16:14 ` Peter Xu
2025-01-16 5:37 ` Akihiko Odaki
2025-01-16 14:33 ` Peter Xu
2025-01-17 6:24 ` Akihiko Odaki
2025-01-17 17:46 ` Peter Xu
2025-01-18 10:15 ` Akihiko Odaki
2025-01-18 12:49 ` Peter Xu
2025-01-09 5:50 ` [PATCH v7 2/2] memory: Do not create circular reference with subregion Akihiko Odaki
2025-01-09 15:55 ` Peter Xu [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Z3_xjlqNyIJAQTYq@x1n \
--to=peterx@redhat.com \
--cc=aik@ozlabs.ru \
--cc=akihiko.odaki@daynix.com \
--cc=alex.bennee@linaro.org \
--cc=balaton@eik.bme.hu \
--cc=danielhb413@gmail.com \
--cc=david@gibson.dropbear.id.au \
--cc=david@redhat.com \
--cc=devel@daynix.com \
--cc=eduardo@habkost.net \
--cc=farosas@suse.de \
--cc=harshpb@linux.ibm.com \
--cc=jiaxun.yang@flygoat.com \
--cc=jsnow@redhat.com \
--cc=lvivier@redhat.com \
--cc=marcel.apfelbaum@gmail.com \
--cc=mst@redhat.com \
--cc=npiggin@gmail.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=philmd@linaro.org \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=thuth@redhat.com \
--cc=wangyanan55@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.