AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Yunxiang Li <Yunxiang.Li@amd.com>
To: <dri-devel@lists.freedesktop.org>, <amd-gfx@lists.freedesktop.org>
Cc: <Alexander.Deucher@amd.com>, <christian.koenig@amd.com>,
	<tvrtko.ursulin@igalia.com>, Yunxiang Li <Yunxiang.Li@amd.com>
Subject: [PATCH v5 0/4] rework bo mem stats tracking
Date: Fri, 18 Oct 2024 09:33:04 -0400	[thread overview]
Message-ID: <20241018133308.889-1-Yunxiang.Li@amd.com> (raw)

Right now every time the fdinfo is read, we go through the vm lists and
lock all the BOs to calcuate the statistics. This causes a lot of lock
contention when the VM is actively used. It gets worse if there is a lot
of shared BOs or if there's a lot of submissions. We have seen
submissions lock-up for seconds due to fdinfo for some workload.
Therefore, rework the implementation to track the BOs as they get moved
around.

Also the visible memory stat is removed to simplify implementation, it's
unclear how useful this stat is since kernel map/unmap BOs whenever it
wants to and on a modern system all of VRAM can be mapped if needed.

v5: rebase on top of the drm_print_memory_stats refactor

Yunxiang Li (4):
  drm/amdgpu: remove unused function parameter
  drm/amdgpu: make drm-memory-* report resident memory
  drm/amdgpu: stop tracking visible memory stats
  drm/amdgpu: track bo memory stats at runtime

 drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c      |   4 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c |  16 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_fdinfo.c  |  24 +--
 drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c     |   3 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_object.c  |  94 +--------
 drivers/gpu/drm/amd/amdgpu/amdgpu_object.h  |  14 --
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c      | 208 +++++++++++++++++---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h      |  27 ++-
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm_pt.c   |   1 +
 drivers/gpu/drm/drm_file.c                  |   8 +
 include/drm/drm_file.h                      |   1 +
 11 files changed, 241 insertions(+), 159 deletions(-)

-- 
2.34.1


             reply	other threads:[~2024-10-18 13:33 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-18 13:33 Yunxiang Li [this message]
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
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=20241018133308.889-1-Yunxiang.Li@amd.com \
    --to=yunxiang.li@amd.com \
    --cc=Alexander.Deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=christian.koenig@amd.com \
    --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