From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Cc: "Daniel Vetter" <daniel.vetter@ffwll.ch>,
"Alex Deucher" <alexdeucher@gmail.com>,
"Christian König" <christian.koenig@amd.com>
Subject: [Intel-gfx] [RFC 0/6] fdinfo alternative memory stats proposal
Date: Mon, 17 Apr 2023 16:56:07 +0100 [thread overview]
Message-ID: <20230417155613.4143258-1-tvrtko.ursulin@linux.intel.com> (raw)
From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
As discussed in the Rob's thread here is a slightly alternative idea on what to
expose and how.
DRM core is still defining a list of common memory categories but it is now up
to drivers to fill in the data and opt into the feature.
There is also no aggregated category and memory regions are always specified in
key names.
Two driver vfuncs are added where DRM core queries the number and names of
memory regions supported by the driver instance, and second where the driver
fills in the usage statistics for centrally defined memory categories.
I think this is a more future proof option since by moving the stat filling to
drivers they are able to show not only the GEM handles but all used memory. For
instance in case of i915 we have contexts, ring buffers, status pages and page
tables all backed by GEM objects too.
It also opens up a route for reporting sub-object size backing store granularity
and allows for not traversing under the file_table lock for drivers which are
able to do it in a more light-weight manner. For the former one example could be
simply adding TTM region helpers.
Not having aggregated counters means we do not need to add a second set of keys
as soon as the first driver wants to provide a more detailed view. And userspace
can trivially aggregate itself anyway.
At the same time two trivial helpers are provided who want to show just the
basic stats.
I have also tried to preserve the drm-memory-$region naming by reserving a
special character ('^') as a suffix ie. drm-memory-$region^$category. Unless I
am missing something this should be compatible with any existing parsers which
would just see more memory regions with more specific names. And they can be
updated to support the format extension.
Series is a bit rough so for discussion only.
Rob Clark (1):
drm: Add common fdinfo helper
Tvrtko Ursulin (5):
drm/i915: Use the fdinfo helper
drm: Add fdinfo memory stats
drm: Add simple fdinfo memory helpers
drm/msm: Add basic memory stats
drm/i915: Implement fdinfo memory stats printing
Documentation/gpu/drm-usage-stats.rst | 22 +++-
drivers/gpu/drm/drm_file.c | 132 +++++++++++++++++++
drivers/gpu/drm/i915/i915_driver.c | 11 +-
drivers/gpu/drm/i915/i915_drm_client.c | 167 +++++++++++++++++--------
drivers/gpu/drm/i915/i915_drm_client.h | 30 ++---
drivers/gpu/drm/i915/i915_drv.h | 4 +-
drivers/gpu/drm/i915/i915_gem.c | 6 +-
drivers/gpu/drm/msm/msm_drv.c | 4 +
include/drm/drm_drv.h | 14 +++
include/drm/drm_file.h | 18 +++
10 files changed, 324 insertions(+), 84 deletions(-)
--
2.37.2
next reply other threads:[~2023-04-17 15:56 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-17 15:56 Tvrtko Ursulin [this message]
2023-04-17 15:56 ` [Intel-gfx] [RFC 1/6] drm: Add common fdinfo helper Tvrtko Ursulin
2023-04-17 15:56 ` [Intel-gfx] [RFC 2/6] drm/i915: Use the " Tvrtko Ursulin
2023-04-17 15:56 ` [Intel-gfx] [RFC 3/6] drm: Add fdinfo memory stats Tvrtko Ursulin
2023-04-17 16:20 ` Christian König
2023-04-18 10:47 ` Tvrtko Ursulin
2023-04-18 14:16 ` Rob Clark
2023-04-17 19:39 ` Rob Clark
2023-04-18 8:59 ` Tvrtko Ursulin
2023-04-18 13:49 ` Rob Clark
2023-04-18 14:18 ` Tvrtko Ursulin
2023-04-18 14:36 ` Rob Clark
2023-04-18 14:45 ` Tvrtko Ursulin
2023-04-18 16:13 ` Rob Clark
2023-04-18 16:44 ` Tvrtko Ursulin
2023-04-18 17:10 ` Rob Clark
2023-04-17 15:56 ` [Intel-gfx] [RFC 4/6] drm: Add simple fdinfo memory helpers Tvrtko Ursulin
2023-04-18 17:18 ` Rob Clark
2023-04-19 13:16 ` Tvrtko Ursulin
2023-04-19 14:32 ` Rob Clark
2023-04-20 13:14 ` Tvrtko Ursulin
2023-04-21 1:24 ` Rob Clark
2023-04-17 15:56 ` [Intel-gfx] [RFC 5/6] drm/msm: Add basic memory stats Tvrtko Ursulin
2023-04-17 15:56 ` [Intel-gfx] [RFC 6/6] drm/i915: Implement fdinfo memory stats printing Tvrtko Ursulin
2023-04-18 14:39 ` Rob Clark
2023-04-18 14:58 ` Tvrtko Ursulin
2023-04-18 16:08 ` Rob Clark
2023-04-19 14:06 ` Tvrtko Ursulin
2023-04-19 14:38 ` Rob Clark
2023-04-20 13:11 ` Tvrtko Ursulin
2023-04-21 1:26 ` Rob Clark
2023-04-17 19:54 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for fdinfo alternative memory stats proposal Patchwork
2023-04-17 19:54 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2023-04-17 20:05 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2023-04-18 7:21 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
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=20230417155613.4143258-1-tvrtko.ursulin@linux.intel.com \
--to=tvrtko.ursulin@linux.intel.com \
--cc=Intel-gfx@lists.freedesktop.org \
--cc=alexdeucher@gmail.com \
--cc=christian.koenig@amd.com \
--cc=daniel.vetter@ffwll.ch \
--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