From: "Alex Bennée" <alex.bennee@linaro.org>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: "Akihiko Odaki" <akihiko.odaki@daynix.com>,
"BALATON Zoltan" <balaton@eik.bme.hu>,
"Peter Xu" <peterx@redhat.com>,
"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>,
"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>,
"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>,
qemu-devel@nongnu.org, qemu-block@nongnu.org,
qemu-ppc@nongnu.org, devel@daynix.com
Subject: Re: [PATCH v7 1/2] memory: Update inline documentation
Date: Thu, 28 Aug 2025 14:17:32 +0100 [thread overview]
Message-ID: <878qj3zitv.fsf@draig.linaro.org> (raw)
In-Reply-To: <CAFEAcA8A97ocOfv72KeSEgFkchmAOfc=GiX8QmvRui5=DDF=qQ@mail.gmail.com> (Peter Maydell's message of "Thu, 28 Aug 2025 11:11:54 +0100")
Peter Maydell <peter.maydell@linaro.org> writes:
> On Fri, 17 Jan 2025 at 06:19, Akihiko Odaki <akihiko.odaki@daynix.com> wrote:
>> Let me explain my and Peter Xu's solutions by listing object references.
>> It will abstract the details away and allow applying the analogy of
>> other reference counting systems like Objective-C.
>>
<snip>
>> "Weak" references
>> -----------------
>>
>> Next, I'll impose the restriction that prevents circular references. To
>> avoid circular references, we'll stop counting references for one
>> direction. In other words, we'll make some references "weak". Weak
>> references are prone to be dangling (in Objective-C or other platforms,
>> such references will be usually replaced with nil-like values).
>
> I'm not sure this is really how we think about the lifetimes
> of these objects, though. In particular, we definitely don't
> ever expect, for instance, the link from a memory region to
> its owner to be dangling.
>
> I think what we actually have is:
> * the thing which really has a reference count is the
> device object
> * this device owns various things (irqs, child objects,
> memory regions, etc)
> * we expect that when we destroy the device that all these
> other things it owns also should be destroyed
> * some parts of the system have free-floating memory regions
> which don't have an owner
> * parts of the code have to deal with both the "MR belonging
> to a device" and the "MR not belonging to a device" case
The virtio-gpu blobs are a special MR which we handle clumsily at the
moment as they are backed by separate thread (virglrenderer) and we need
to jump through hoops (c.f. virtio_gpu_virgl_hostmem_region_free) to
make sure it is done with the memory before we can free the container.
<snip>
--
Alex Bennée
Virtualisation Tech Lead @ Linaro
next prev parent reply other threads:[~2025-08-28 17:27 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 [this message]
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
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=878qj3zitv.fsf@draig.linaro.org \
--to=alex.bennee@linaro.org \
--cc=aik@ozlabs.ru \
--cc=akihiko.odaki@daynix.com \
--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=peterx@redhat.com \
--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.