mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: shechenglong <shechenglong@xfusion.com>
To: <dmitry.osipenko@collabora.com>, <airlied@redhat.com>,
	<kraxel@redhat.com>, <tzimmermann@suse.de>
Cc: <gurchetansingh@chromium.org>, <olvaffe@gmail.com>,
	<maarten.lankhorst@linux.intel.com>, <mripard@kernel.org>,
	<simona@ffwll.ch>, <dri-devel@lists.freedesktop.org>,
	<virtualization@lists.linux.dev>, <linux-kernel@vger.kernel.org>,
	<stone.xulei@xfusion.com>, <chenjialong@xfusion.com>
Subject: Re: [PATCH RESEND] drm/virtio: expose GEM memory statistics through fdinfo
Date: Fri, 9 Oct 2026 00:41:34 +0800	[thread overview]
Message-ID: <20261008164135.510-1-shechenglong@xfusion.com> (raw)
In-Reply-To: <ce72b2f5-1343-44e9-89fe-e2de4efb7e9c@collabora.com>

On Thu, 8 Oct 2026 00:44:34 +0300, Dmitry Osipenko wrote:
> Usefulness of this change is dubious. VirtIO-GPU has different types of
> RAM, I'd expect them all represented properly instead of only shmem.

Hi Dmitry,

Thanks for the review.

Agreed that a generic memory collector does not map well onto
virtio-gpu, given its different memory types. For v2, I plan to
replace it with virtio-gpu-specific accounting and to document the
semantics of each reported value explicitly:

- Guest shmem objects: reported under the "memory" region as
  drm-total/drm-shared, based on the guest GEM object size. These
  reflect the requested buffer size; drm-resident, if reported, would
  be derived from the actual state of the guest backing pages.

- Host-only blobs (VIRTGPU_BLOB_MEM_HOST3D): reported under a separate
  region, tentatively "host3d", using the requested blob size. These
  values would be documented as logical sizes and not as actual host
  RAM or VRAM consumption.

- Mixed blobs (VIRTGPU_BLOB_MEM_HOST3D_GUEST): the guest shadow
  backing is accounted under "memory", while the logical blob size is
  exposed through a separate, documented supplementary key. This
  distinguishes mixed resources from guest-only ones without
  presenting the supplementary value as additional measured host
  memory.

- Imported dma-bufs: handled explicitly, without assuming that they
  are backed by local shmem.

Usage of the host-visible memory region would be reported separately
from the backing statistics and would not be used to infer host
residency.

The actual host allocation size and residency, including legacy virgl
resources and the host part of mixed blobs, are not available through
the existing guest/host interface. Reporting them would require
additional host/renderer support, so I propose leaving that out of
this series unless you consider it a prerequisite.

Does this scope match your expectations for v2? Are there other
memory types or accounting semantics you would like covered?

Best regards,
Chenglong She

      reply	other threads:[~2026-10-08 16:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-22  9:44 [PATCH] " shechenglong
2026-09-28 13:36 ` [PATCH RESEND] " shechenglong
2026-10-07 21:44   ` Dmitry Osipenko
2026-10-08 16:41     ` shechenglong [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=20261008164135.510-1-shechenglong@xfusion.com \
    --to=shechenglong@xfusion.com \
    --cc=airlied@redhat.com \
    --cc=chenjialong@xfusion.com \
    --cc=dmitry.osipenko@collabora.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gurchetansingh@chromium.org \
    --cc=kraxel@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=olvaffe@gmail.com \
    --cc=simona@ffwll.ch \
    --cc=stone.xulei@xfusion.com \
    --cc=tzimmermann@suse.de \
    --cc=virtualization@lists.linux.dev \
    /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®