All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Stone <daniel@fooishbar.org>
To: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
Cc: intel-gfx <Intel-gfx@lists.freedesktop.org>,
	"Tvrtko Ursulin" <tvrtko.ursulin@intel.com>,
	"Christian König" <christian.koenig@amd.com>,
	dri-devel <dri-devel@lists.freedesktop.org>,
	"David M Nieto" <David.Nieto@amd.com>
Subject: Re: [RFC 6/8] drm: Document fdinfo format specification
Date: Fri, 23 Jul 2021 17:43:01 +0100	[thread overview]
Message-ID: <CAPj87rMxvq2c9uQ-ArvsLo2M7rXq=7LiJZ_XJwST=1VDhhNXRA@mail.gmail.com> (raw)
In-Reply-To: <20210715091820.1613726-7-tvrtko.ursulin@linux.intel.com>

Hi Tvrtko,
Thanks for typing this up!

On Thu, 15 Jul 2021 at 10:18, Tvrtko Ursulin
<tvrtko.ursulin@linux.intel.com> wrote:
> +Mandatory fully standardised keys
> +---------------------------------
> +
> +- drm-driver: <str>
> +
> +String shall contain a fixed string uniquely identified the driver handling
> +the device in question. For example name of the respective kernel module.

I think let's be more prescriptive and just say that it is the module name.

> +Optional fully standardised keys
> +--------------------------------
> +
> +- drm-pdev: <aaaa:bb.cc.d>
> +
> +For PCI devices this should contain the PCI slot address of the device in
> +question.

How about just major:minor of the DRM render node device it's attached to?

> +- drm-client-id: <uint>
> +
> +Unique value relating to the open DRM file descriptor used to distinguish
> +duplicated and shared file descriptors. Conceptually the value should map 1:1
> +to the in kernel representation of `struct drm_file` instances.
> +
> +Uniqueness of the value shall be either globally unique, or unique within the
> +scope of each device, in which case `drm-pdev` shall be present as well.
> +
> +Userspace should make sure to not double account any usage statistics by using
> +the above described criteria in order to associate data to individual clients.
> +
> +- drm-engine-<str>: <uint> ns
> +
> +GPUs usually contain multiple execution engines. Each shall be given a stable
> +and unique name (str), with possible values documented in the driver specific
> +documentation.
> +
> +Value shall be in specified time units which the respective GPU engine spent
> +busy executing workloads belonging to this client.
> +
> +Values are not required to be constantly monotonic if it makes the driver
> +implementation easier, but are required to catch up with the previously reported
> +larger value within a reasonable period. Upon observing a value lower than what
> +was previously read, userspace is expected to stay with that larger previous
> +value until a monotonic update is seen.

Yeah, that would work well for Mali/Panfrost. We can queue multiple
jobs in the hardware, which can either be striped across multiple
cores with an affinity mask (e.g. 3 cores for your client and 1 for
your compositor), or picked according to priority, or ...

The fine-grained performance counters (e.g. time spent waiting for
sampler) are only GPU-global. So if you have two jobs running
simultaneously, you have no idea who's responsible for what.

But it does give us coarse-grained counters which are accounted
per-job-slot, including exactly this metric: amount of 'GPU time'
(whatever that means) occupied by that job slot during the sampling
period. So we could support that nicely if we fenced job-slot updates
with register reads/writes.

Something I'm missing though is how we enable this information. Seems
like it would be best to either only do it whilst fdinfo is open (and
re-read it whenever you need an update), or on a per-driver sysfs
toggle, or ... ?

> +- drm-memory-<str>: <uint> [KiB|MiB]
> +
> +Each possible memory type which can be used to store buffer objects by the
> +GPU in question shall be given a stable and unique name to be returned as the
> +string here.
> +
> +Value shall reflect the amount of storage currently consumed by the buffer
> +object belong to this client, in the respective memory region.
> +
> +Default unit shall be bytes with optional unit specifiers of 'KiB' or 'MiB'
> +indicating kibi- or mebi-bytes.

I'm a bit wary of the accounting here. Is it buffer allocations
originating from the client, in which case it conceptually clashes
with gralloc? Is it the client which last wrote to the buffer? The
client with the oldest open handle to the buffer? Other?

Cheers,
Daniel

WARNING: multiple messages have this Message-ID (diff)
From: Daniel Stone <daniel@fooishbar.org>
To: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
Cc: intel-gfx <Intel-gfx@lists.freedesktop.org>,
	"Christian König" <christian.koenig@amd.com>,
	dri-devel <dri-devel@lists.freedesktop.org>,
	"David M Nieto" <David.Nieto@amd.com>
Subject: Re: [Intel-gfx] [RFC 6/8] drm: Document fdinfo format specification
Date: Fri, 23 Jul 2021 17:43:01 +0100	[thread overview]
Message-ID: <CAPj87rMxvq2c9uQ-ArvsLo2M7rXq=7LiJZ_XJwST=1VDhhNXRA@mail.gmail.com> (raw)
In-Reply-To: <20210715091820.1613726-7-tvrtko.ursulin@linux.intel.com>

Hi Tvrtko,
Thanks for typing this up!

On Thu, 15 Jul 2021 at 10:18, Tvrtko Ursulin
<tvrtko.ursulin@linux.intel.com> wrote:
> +Mandatory fully standardised keys
> +---------------------------------
> +
> +- drm-driver: <str>
> +
> +String shall contain a fixed string uniquely identified the driver handling
> +the device in question. For example name of the respective kernel module.

I think let's be more prescriptive and just say that it is the module name.

> +Optional fully standardised keys
> +--------------------------------
> +
> +- drm-pdev: <aaaa:bb.cc.d>
> +
> +For PCI devices this should contain the PCI slot address of the device in
> +question.

How about just major:minor of the DRM render node device it's attached to?

> +- drm-client-id: <uint>
> +
> +Unique value relating to the open DRM file descriptor used to distinguish
> +duplicated and shared file descriptors. Conceptually the value should map 1:1
> +to the in kernel representation of `struct drm_file` instances.
> +
> +Uniqueness of the value shall be either globally unique, or unique within the
> +scope of each device, in which case `drm-pdev` shall be present as well.
> +
> +Userspace should make sure to not double account any usage statistics by using
> +the above described criteria in order to associate data to individual clients.
> +
> +- drm-engine-<str>: <uint> ns
> +
> +GPUs usually contain multiple execution engines. Each shall be given a stable
> +and unique name (str), with possible values documented in the driver specific
> +documentation.
> +
> +Value shall be in specified time units which the respective GPU engine spent
> +busy executing workloads belonging to this client.
> +
> +Values are not required to be constantly monotonic if it makes the driver
> +implementation easier, but are required to catch up with the previously reported
> +larger value within a reasonable period. Upon observing a value lower than what
> +was previously read, userspace is expected to stay with that larger previous
> +value until a monotonic update is seen.

Yeah, that would work well for Mali/Panfrost. We can queue multiple
jobs in the hardware, which can either be striped across multiple
cores with an affinity mask (e.g. 3 cores for your client and 1 for
your compositor), or picked according to priority, or ...

The fine-grained performance counters (e.g. time spent waiting for
sampler) are only GPU-global. So if you have two jobs running
simultaneously, you have no idea who's responsible for what.

But it does give us coarse-grained counters which are accounted
per-job-slot, including exactly this metric: amount of 'GPU time'
(whatever that means) occupied by that job slot during the sampling
period. So we could support that nicely if we fenced job-slot updates
with register reads/writes.

Something I'm missing though is how we enable this information. Seems
like it would be best to either only do it whilst fdinfo is open (and
re-read it whenever you need an update), or on a per-driver sysfs
toggle, or ... ?

> +- drm-memory-<str>: <uint> [KiB|MiB]
> +
> +Each possible memory type which can be used to store buffer objects by the
> +GPU in question shall be given a stable and unique name to be returned as the
> +string here.
> +
> +Value shall reflect the amount of storage currently consumed by the buffer
> +object belong to this client, in the respective memory region.
> +
> +Default unit shall be bytes with optional unit specifiers of 'KiB' or 'MiB'
> +indicating kibi- or mebi-bytes.

I'm a bit wary of the accounting here. Is it buffer allocations
originating from the client, in which case it conceptually clashes
with gralloc? Is it the client which last wrote to the buffer? The
client with the oldest open handle to the buffer? Other?

Cheers,
Daniel
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2021-07-23 16:43 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-15  9:18 [RFC 0/8] Per client GPU stats Tvrtko Ursulin
2021-07-15  9:18 ` [Intel-gfx] " Tvrtko Ursulin
2021-07-15  9:18 ` [RFC 1/8] drm/i915: Explicitly track DRM clients Tvrtko Ursulin
2021-07-15  9:18   ` [Intel-gfx] " Tvrtko Ursulin
2021-07-15  9:18 ` [RFC 2/8] drm/i915: Make GEM contexts " Tvrtko Ursulin
2021-07-15  9:18   ` [Intel-gfx] " Tvrtko Ursulin
2021-07-15  9:18 ` [RFC 3/8] drm/i915: Track runtime spent in closed and unreachable GEM contexts Tvrtko Ursulin
2021-07-15  9:18   ` [Intel-gfx] " Tvrtko Ursulin
2021-07-15  9:18 ` [RFC 4/8] drm/i915: Track all user contexts per client Tvrtko Ursulin
2021-07-15  9:18   ` [Intel-gfx] " Tvrtko Ursulin
2021-07-15  9:18 ` [RFC 5/8] drm/i915: Track context current active time Tvrtko Ursulin
2021-07-15  9:18   ` [Intel-gfx] " Tvrtko Ursulin
2021-07-15  9:18 ` [RFC 6/8] drm: Document fdinfo format specification Tvrtko Ursulin
2021-07-15  9:18   ` [Intel-gfx] " Tvrtko Ursulin
2021-07-23 16:43   ` Daniel Stone [this message]
2021-07-23 16:43     ` Daniel Stone
2021-07-23 16:47     ` Daniel Vetter
2021-07-23 16:47       ` [Intel-gfx] " Daniel Vetter
2021-07-23 17:45       ` Nieto, David M
2021-07-23 17:45         ` [Intel-gfx] " Nieto, David M
2021-07-26  9:01         ` Tvrtko Ursulin
2021-07-26  9:01           ` [Intel-gfx] " Tvrtko Ursulin
2021-07-26  8:57     ` Tvrtko Ursulin
2021-07-26  8:57       ` [Intel-gfx] " Tvrtko Ursulin
2021-07-15  9:18 ` [RFC 7/8] drm/i915: Expose client engine utilisation via fdinfo Tvrtko Ursulin
2021-07-15  9:18   ` [Intel-gfx] " Tvrtko Ursulin
2021-07-15  9:18 ` [RFC 8/8] drm/amdgpu: Convert to common fdinfo format Tvrtko Ursulin
2021-07-15  9:18   ` [Intel-gfx] " Tvrtko Ursulin
2021-07-23 13:56   ` Alex Deucher
2021-07-23 13:56     ` [Intel-gfx] " Alex Deucher
2021-07-16 17:58 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for Per client GPU stats (rev2) Patchwork
2021-07-16 17:59 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2021-07-16 18:03 ` [Intel-gfx] ✗ Fi.CI.DOCS: " Patchwork
2021-07-16 18:24 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2021-07-16 23:58 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
2021-07-23 11:21 ` [Intel-gfx] [RFC 0/8] Per client GPU stats Tvrtko Ursulin
2021-07-23 11:21   ` Tvrtko Ursulin
2021-07-23 11:23   ` Christian König
2021-07-23 11:23     ` Christian König
2021-07-23 13:50     ` Tvrtko Ursulin
2021-07-23 13:50       ` Tvrtko Ursulin
2021-07-23 13:55       ` Alex Deucher
2021-07-23 13:55         ` Alex Deucher
2021-08-23 11:28 Tvrtko Ursulin
2021-08-23 11:28 ` [RFC 6/8] drm: Document fdinfo format specification Tvrtko Ursulin
2021-08-23 13:32   ` Christian König
2021-08-24  9:25     ` Tvrtko Ursulin
2021-08-24  9:34       ` Christian König

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='CAPj87rMxvq2c9uQ-ArvsLo2M7rXq=7LiJZ_XJwST=1VDhhNXRA@mail.gmail.com' \
    --to=daniel@fooishbar.org \
    --cc=David.Nieto@amd.com \
    --cc=Intel-gfx@lists.freedesktop.org \
    --cc=christian.koenig@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=tvrtko.ursulin@intel.com \
    --cc=tvrtko.ursulin@linux.intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.