mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Lizhi Hou <lizhi.hou@amd.com>
To: Ian Rogers <irogers@google.com>
Cc: Mario Limonciello <mario.limonciello@amd.com>,
	<ogabbay@kernel.org>, <quic_jhugo@quicinc.com>,
	<dri-devel@lists.freedesktop.org>,
	<maciej.falkowski@linux.intel.com>, Max Zhen <max.zhen@amd.com>,
	<linux-kernel@vger.kernel.org>, <sonal.santan@amd.com>
Subject: Re: [PATCH V1] accel/amdxdna: Add per-process BO memory usage query support
Date: Tue, 31 Mar 2026 08:53:10 -0700	[thread overview]
Message-ID: <d677429c-9ed0-5c05-02c3-05a375e46c38@amd.com> (raw)
In-Reply-To: <CAP-5=fWFnuZt5CvF--qLfsp6eKkCSUHttCVzp_pzEqT57ZupDw@mail.gmail.com>


On 3/30/26 19:30, Ian Rogers wrote:
> On Wed, Mar 25, 2026 at 11:47 AM Lizhi Hou <lizhi.hou@amd.com> wrote:
>> Applied to drm-misc-next.
>>
>> On 3/24/26 10:01, Mario Limonciello wrote:
>>>
>>> On 3/24/26 11:31, Lizhi Hou wrote:
>>>> From: Max Zhen <max.zhen@amd.com>
>>>>
>>>> Add support for querying per-process buffer object (BO) memory
>>>> usage through the amdxdna GET_ARRAY UAPI.
>>>>
>>>> Introduce a new query type, DRM_AMDXDNA_BO_USAGE, along with
>>>> struct amdxdna_drm_bo_usage to report BO memory usage statistics,
>>>> including heap, total, and internal usage.
>>>>
>>>> Track BO memory usage on a per-client basis by maintaining counters
>>>> in GEM open/close and heap allocation/free paths. This ensures the
>>>> reported statistics reflect the current memory footprint of each
>>>> process.
>>>>
>>>> Wire the new query into the GET_ARRAY implementation to expose
>>>> the usage information to userspace.
>>>>
>>>> Signed-off-by: Max Zhen <max.zhen@amd.com>
>>>> Reviewed-by: Lizhi Hou <lizhi.hou@amd.com>
>>>> Signed-off-by: Lizhi Hou <lizhi.hou@amd.com>
>>> I'm assuming you also have userspace side ready for this too right?
>>> If you have a link handy can you please include it when committing.
> Sorry for a naive question, would support in procfs be possible?

Do you mean fdinfo? And yes, the fdinfo is in our upstream stack. I will 
post the patch later.

Lizhi

> There's support in perf for displaying DRM usage stat data from there
> [1], for example:
> ```
> $ perf list drm-
>
> List of pre-defined events (to be used in -e or -M):
>
>
> drm:
>   drm-active-stolen-system0
>        [Total memory active in one or more engines. Unit: drm_i915]
>   drm-active-system0
>        [Total memory active in one or more engines. Unit: drm_i915]
>   drm-engine-capacity-video
>        [Engine capacity. Unit: drm_i915]
>   drm-engine-copy
>        [Utilization in ns. Unit: drm_i915]
>   drm-engine-render
>        [Utilization in ns. Unit: drm_i915]
>   drm-engine-video
>        [Utilization in ns. Unit: drm_i915]
>   drm-engine-video-enhance
>        [Utilization in ns. Unit: drm_i915]
>   drm-purgeable-stolen-system0
>        [Size of resident and purgeable memory buffers. Unit: drm_i915]
>   drm-purgeable-system0
>        [Size of resident and purgeable memory buffers. Unit: drm_i915]
>   drm-resident-stolen-system0
>        [Size of resident memory buffers. Unit: drm_i915]
>   drm-resident-system0
>        [Size of resident memory buffers. Unit: drm_i915]
>   drm-shared-stolen-system0
>        [Size of shared memory buffers. Unit: drm_i915]
>   drm-shared-system0
>        [Size of shared memory buffers. Unit: drm_i915]
>   drm-total-stolen-system0
>        [Size of shared and private memory. Unit: drm_i915]
>   drm-total-system0
>        [Size of shared and private memory. Unit: drm_i915]
>
>
> $ perf stat -e drm-engine-render -a sleep 1
>
> Performance counter stats for 'system wide':
>
>    557,542,732,344 ns   drm-engine-render
>
>        1.001575975 seconds time elapsed
> ```
>
> Thanks,
> Ian
>
> [1] https://lore.kernel.org/lkml/20250403202439.57791-1-irogers@google.com/

  reply	other threads:[~2026-03-31 15:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-24 16:31 Lizhi Hou
2026-03-24 17:01 ` Mario Limonciello
2026-03-24 20:45   ` Lizhi Hou
2026-03-25 18:46   ` Lizhi Hou
2026-03-31  2:30     ` Ian Rogers
2026-03-31 15:53       ` Lizhi Hou [this message]
2026-03-31 16:19         ` Ian Rogers

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=d677429c-9ed0-5c05-02c3-05a375e46c38@amd.com \
    --to=lizhi.hou@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=irogers@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maciej.falkowski@linux.intel.com \
    --cc=mario.limonciello@amd.com \
    --cc=max.zhen@amd.com \
    --cc=ogabbay@kernel.org \
    --cc=quic_jhugo@quicinc.com \
    --cc=sonal.santan@amd.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®