From: "Christian König" <christian.koenig@amd.com>
To: "Danilo Krummrich" <dakr@redhat.com>,
"Thomas Hellström" <thomas.hellstrom@linux.intel.com>
Cc: airlied@gmail.com, daniel@ffwll.ch, matthew.brost@intel.com,
sarah.walker@imgtec.com, donald.robson@imgtec.com,
boris.brezillon@collabora.com, faith@gfxstrand.net,
dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH drm-misc-next v8 09/12] drm/gpuvm: reference count drm_gpuvm structures
Date: Mon, 13 Nov 2023 08:22:18 +0100 [thread overview]
Message-ID: <71a50cac-3253-480f-adff-da475738ae6b@amd.com> (raw)
In-Reply-To: <987ac707-8f9b-4e33-86c3-decdc1c48a3a@redhat.com>
Am 10.11.23 um 17:57 schrieb Danilo Krummrich:
> On 11/10/23 09:50, Christian König wrote:
>> [SNIP]
>>>>
>>>>>
>>>>> Another issue Christian brought up is that something intended to
>>>>> be embeddable (a base class) shouldn't really have its own
>>>>> refcount. I think that's a valid point. If you at some point need
>>>>> to derive from multiple such structs each having its own refcount,
>>>>> things will start to get weird. One way to resolve that would be
>>>>> to have the driver's subclass provide get() and put() ops, and
>>>>> export a destructor for the base-class, rather than to have the
>>>>> base-class provide the refcount and a destructor ops.
>>>
>>> GPUVM simply follows the same pattern we have with drm_gem_objects.
>>> And I think it makes
>>> sense. Why would we want to embed two struct drm_gpuvm in a single
>>> driver structure?
>>
>> Because you need one drm_gpuvm structure for each application using
>> the driver? Or am I missing something?
>
> Right, *one*, but not more than one. Wasn't that the concern? Maybe I
> misunderstood something. :)
Well, there is the use case of native context with XEN/KVM. In that
situation QEMU opens tons of driver file descriptors on behalves of the
virtual environment clients.
In this use case you have many drm_gpuvm instances for a single
application. So you can't assume that you only have one VM per PID/TGID
or something like that.
AMD already made that mistake with KFD and I strongly suggest not to
repeat it :)
Regards,
Christian.
next prev parent reply other threads:[~2023-11-13 7:22 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-01 23:30 [PATCH drm-misc-next v8 00/12] [RFC] DRM GPUVM features Danilo Krummrich
2023-11-01 23:30 ` [PATCH drm-misc-next v8 01/12] drm/gpuvm: convert WARN() to drm_WARN() variants Danilo Krummrich
2023-11-01 23:30 ` [PATCH drm-misc-next v8 02/12] drm/gpuvm: don't always WARN in drm_gpuvm_check_overflow() Danilo Krummrich
2023-11-02 13:19 ` Thomas Hellström
2023-11-01 23:30 ` [PATCH drm-misc-next v8 03/12] drm/gpuvm: export drm_gpuvm_range_valid() Danilo Krummrich
2023-11-02 13:20 ` Thomas Hellström
2023-11-01 23:30 ` [PATCH drm-misc-next v8 04/12] drm/nouveau: make use of drm_gpuvm_range_valid() Danilo Krummrich
2023-11-02 4:46 ` Dave Airlie
2023-11-01 23:30 ` [PATCH drm-misc-next v8 05/12] drm/gpuvm: add common dma-resv per struct drm_gpuvm Danilo Krummrich
2023-11-01 23:30 ` [PATCH drm-misc-next v8 06/12] drm/nouveau: make use of the GPUVM's shared dma-resv Danilo Krummrich
2023-11-01 23:30 ` [PATCH drm-misc-next v8 07/12] drm/gpuvm: add drm_gpuvm_flags to drm_gpuvm Danilo Krummrich
2023-11-01 23:31 ` [PATCH drm-misc-next v8 08/12] drm/nouveau: separately allocate struct nouveau_uvmm Danilo Krummrich
2023-11-02 4:44 ` Dave Airlie
2023-11-01 23:31 ` [PATCH drm-misc-next v8 09/12] drm/gpuvm: reference count drm_gpuvm structures Danilo Krummrich
2023-11-02 10:46 ` kernel test robot
2023-11-02 13:21 ` Thomas Hellström
2023-11-02 17:09 ` Thomas Hellström
2023-11-02 17:32 ` Danilo Krummrich
2023-11-02 18:04 ` Thomas Hellström
2023-11-03 7:18 ` Christian König
2023-11-03 13:14 ` Danilo Krummrich
[not found] ` <a2e13a27-d2e5-4ae3-9c11-c18b425b69cc@amd.com>
2023-11-03 15:34 ` Danilo Krummrich
2023-11-06 9:14 ` Christian König
2023-11-06 12:16 ` Danilo Krummrich
[not found] ` <8e87d962-c80c-40d9-94d7-58b6cd9dd794@amd.com>
2023-11-06 14:11 ` Danilo Krummrich
[not found] ` <6d3c48f6-a92d-49b3-b836-ee1bc95b56bf@amd.com>
2023-11-06 16:42 ` Danilo Krummrich
2023-11-09 15:50 ` Thomas Hellström
2023-11-09 16:03 ` Christian König
2023-11-09 18:34 ` Danilo Krummrich
2023-11-10 8:50 ` Christian König
2023-11-10 9:39 ` Thomas Hellström
2023-11-10 10:42 ` Christian König
2023-11-10 10:52 ` Thomas Hellström
2023-11-10 16:49 ` Danilo Krummrich
2023-11-10 16:43 ` Danilo Krummrich
2023-11-10 16:57 ` Danilo Krummrich
2023-11-13 7:22 ` Christian König [this message]
2023-11-13 12:57 ` Danilo Krummrich
2023-11-01 23:31 ` [PATCH drm-misc-next v8 10/12] drm/gpuvm: add an abstraction for a VM / BO combination Danilo Krummrich
2023-11-02 13:25 ` Thomas Hellström
2023-11-02 17:16 ` Thomas Hellström
2023-11-01 23:31 ` [PATCH drm-misc-next v8 11/12] drm/gpuvm: track/lock/validate external/evicted objects Danilo Krummrich
2023-11-01 23:31 ` [PATCH drm-misc-next v8 12/12] drm/nouveau: use GPUVM common infrastructure Danilo Krummrich
2023-11-02 4:47 ` Dave Airlie
2023-11-02 13:18 ` Thomas Hellström
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=71a50cac-3253-480f-adff-da475738ae6b@amd.com \
--to=christian.koenig@amd.com \
--cc=airlied@gmail.com \
--cc=boris.brezillon@collabora.com \
--cc=dakr@redhat.com \
--cc=daniel@ffwll.ch \
--cc=donald.robson@imgtec.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=faith@gfxstrand.net \
--cc=linux-kernel@vger.kernel.org \
--cc=matthew.brost@intel.com \
--cc=nouveau@lists.freedesktop.org \
--cc=sarah.walker@imgtec.com \
--cc=thomas.hellstrom@linux.intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®