From: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
To: "Christian König" <christian.koenig@amd.com>,
"Li, Yunxiang (Teddy)" <Yunxiang.Li@amd.com>,
"dri-devel@lists.freedesktop.org"
<dri-devel@lists.freedesktop.org>,
"amd-gfx@lists.freedesktop.org" <amd-gfx@lists.freedesktop.org>
Cc: "Deucher, Alexander" <Alexander.Deucher@amd.com>
Subject: Re: [PATCH v5 4/4] drm/amdgpu: track bo memory stats at runtime
Date: Wed, 23 Oct 2024 08:33:46 +0100 [thread overview]
Message-ID: <8a6e6fce-e3df-40e9-ab1b-f5d641e078bd@igalia.com> (raw)
In-Reply-To: <3930f491-10a2-4863-8e24-009d3fbc2b23@amd.com>
On 22/10/2024 18:06, Christian König wrote:
> Am 22.10.24 um 18:46 schrieb Li, Yunxiang (Teddy):
>> [Public]
>>
>> I suppose we could add a field like amd-memory-private: to cover the
>> private placements.
>
> No, that is not really appropriate either. GWS, GDS and OA are not
> memory in the first place.
>
> Those BOs are HW blocks which the driver allocated to use.
>
> So accounting them for the memory usage doesn't make any sense at all.
>
> We could print them in the fdinfo as something special for statistics,
> but it's probably not that useful.
>
>> When would a BO not have a placement, is it when it is being moved?
>
> There are BOs which are only temporary, so when they are evicted their
> backing store is just discarded.
>
> Additional to that allocation of backing store is sometimes delayed
> until the first use.
Would this work correctly if instead of preferred allowed mask was used?
Point being, to correctly support fdinfo stats drm-total-, *if* a BO
*can* have a backing store at any point it should always be counted there.
*If* it currently has a placement it is drm-resident-.
If it has a placement but can be discarded it is drm-purgeable-. Etc.
Regards,
Tvrtko
>
>> Since we are tracking the state changes, I wonder if such situations
>> can be avoided now so whenever we call these stat update functions the
>> BO would always have a placement.
>
> No, as I said before those use cases are perfectly valid. BO don't need
> a backing store nor do they need a placement.
>
> So the code has to gracefully handle that.
>
> Regards,
> Christian.
>
>>
>> Teddy
>
next prev parent reply other threads:[~2024-10-23 13:41 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
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 [this message]
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=8a6e6fce-e3df-40e9-ab1b-f5d641e078bd@igalia.com \
--to=tvrtko.ursulin@igalia.com \
--cc=Alexander.Deucher@amd.com \
--cc=Yunxiang.Li@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=christian.koenig@amd.com \
--cc=dri-devel@lists.freedesktop.org \
/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