From: "Christian König" <christian.koenig@amd.com>
To: Yunxiang Li <Yunxiang.Li@amd.com>,
dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org
Cc: Alexander.Deucher@amd.com, tvrtko.ursulin@igalia.com
Subject: Re: [PATCH v5 2/4] drm/amdgpu: make drm-memory-* report resident memory
Date: Tue, 22 Oct 2024 09:00:16 +0200 [thread overview]
Message-ID: <93f99003-f534-4e1e-985d-6dc64e469abb@amd.com> (raw)
In-Reply-To: <20241018133308.889-3-Yunxiang.Li@amd.com>
Am 18.10.24 um 15:33 schrieb Yunxiang Li:
> The old behavior reports the resident memory usage for this key and the
> documentation say so as well. However this was accidentally changed to
> include buffers that was evicted.
>
> Fixes: a2529f67e2ed ("drm/amdgpu: Use drm_print_memory_stats helper from fdinfo")
> Signed-off-by: Yunxiang Li <Yunxiang.Li@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_fdinfo.c | 7 ++++---
> drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 1 -
> drivers/gpu/drm/amd/amdgpu/amdgpu_object.h | 1 -
> 3 files changed, 4 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_fdinfo.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_fdinfo.c
> index 00a4ab082459f..8281dd45faaa0 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_fdinfo.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_fdinfo.c
> @@ -33,6 +33,7 @@
> #include <drm/amdgpu_drm.h>
> #include <drm/drm_debugfs.h>
> #include <drm/drm_drv.h>
> +#include <drm/drm_file.h>
>
> #include "amdgpu.h"
> #include "amdgpu_vm.h"
> @@ -95,11 +96,11 @@ void amdgpu_show_fdinfo(struct drm_printer *p, struct drm_file *file)
>
> /* Legacy amdgpu keys, alias to drm-resident-memory-: */
> drm_printf(p, "drm-memory-vram:\t%llu KiB\n",
> - stats[TTM_PL_VRAM].total/1024UL);
> + stats[TTM_PL_VRAM].drm.resident/1024UL);
> drm_printf(p, "drm-memory-gtt: \t%llu KiB\n",
> - stats[TTM_PL_TT].total/1024UL);
> + stats[TTM_PL_TT].drm.resident/1024UL);
> drm_printf(p, "drm-memory-cpu: \t%llu KiB\n",
> - stats[TTM_PL_SYSTEM].total/1024UL);
> + stats[TTM_PL_SYSTEM].drm.resident/1024UL);
>
> /* Amdgpu specific memory accounting keys: */
> drm_printf(p, "amd-memory-visible-vram:\t%llu KiB\n",
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
> index 045222b6bd049..2a53e72f3964f 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
> @@ -1223,7 +1223,6 @@ void amdgpu_bo_get_memory(struct amdgpu_bo *bo,
>
> /* DRM stats common fields: */
>
> - stats[type].total += size;
> if (drm_gem_object_is_shared_for_memory_stats(obj))
> stats[type].drm.shared += size;
> else
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h
> index 7260349917ef0..a5653f474f85c 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h
> @@ -142,7 +142,6 @@ struct amdgpu_bo_vm {
> struct amdgpu_mem_stats {
> struct drm_memory_stats drm;
>
> - uint64_t total;
> uint64_t visible;
> uint64_t evicted;
> uint64_t evicted_visible;
next prev parent reply other threads:[~2024-10-22 7:00 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-18 13:33 [PATCH v5 0/4] rework bo mem stats tracking Yunxiang Li
2024-10-18 13:33 ` [PATCH v5 1/4] drm/amdgpu: remove unused function parameter Yunxiang Li
2024-10-22 6:58 ` Christian König
2024-10-18 13:33 ` [PATCH v5 2/4] drm/amdgpu: make drm-memory-* report resident memory Yunxiang Li
2024-10-18 15:39 ` Tvrtko Ursulin
2024-10-22 7:00 ` Christian König [this message]
2024-10-18 13:33 ` [PATCH v5 3/4] drm/amdgpu: stop tracking visible memory stats Yunxiang Li
2024-10-22 7:22 ` Christian König
2024-10-18 13:33 ` [PATCH v5 4/4] drm/amdgpu: track bo memory stats at runtime Yunxiang Li
2024-10-22 7:43 ` Christian König
2024-10-22 15:17 ` Li, Yunxiang (Teddy)
2024-10-22 16:24 ` Christian König
2024-10-22 16:46 ` Li, Yunxiang (Teddy)
2024-10-22 17:06 ` Christian König
2024-10-22 17:09 ` Li, Yunxiang (Teddy)
2024-10-23 6:34 ` Christian König
2024-10-23 7:33 ` Tvrtko Ursulin
2024-10-23 7:38 ` Tvrtko Ursulin
2024-10-23 9:14 ` Christian König
2024-10-23 11:37 ` Tvrtko Ursulin
2024-10-23 12:12 ` Christian König
2024-10-23 12:24 ` Tvrtko Ursulin
2024-10-23 12:56 ` Christian König
2024-10-24 8:29 ` Tvrtko Ursulin
2024-10-23 13:31 ` Li, Yunxiang (Teddy)
2024-10-23 13:40 ` Li, Yunxiang (Teddy)
2024-10-23 14:27 ` Tvrtko Ursulin
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=93f99003-f534-4e1e-985d-6dc64e469abb@amd.com \
--to=christian.koenig@amd.com \
--cc=Alexander.Deucher@amd.com \
--cc=Yunxiang.Li@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=tvrtko.ursulin@igalia.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