intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [Intel-gfx] [PATCH] drm/i915/fdinfo: Enable fdinfo for GuC backends
@ 2023-03-31 20:01 Umesh Nerlige Ramappa
  0 siblings, 0 replies; 4+ messages in thread
From: Umesh Nerlige Ramappa @ 2023-03-31 20:01 UTC (permalink / raw)
  To: intel-gfx

The underlying mechanism used to provide the client specific utilization
in fdinfo is context busyness. When a context switches out, the HW
records the runtime in the specific context field. This information is
accumulated in fdinfo. This information is independent of the scheduling
backend as long as contexts are switching out in reasonable time.

If a context is actively running on the engine, then the active busyness
is calculated by using the delta between current time and the context
switch in time. This part of the calculation depends on the scheduling
backend. For GuC backends, this data comes entirely from GuC FW. The FW
implementation is WIP.

Enable fdinfo for GuC based platforms with the exception that long
running contexts will not provide reliable busyness data unless they
switch out at some reasonable point in time.

Revert "drm/i915: Don't show engine information in fdinfo with GuC submission"
This reverts commit 8d0e3decf26bc423d8b1c42c05636ccc05ea6b17.

Resolves: https://gitlab.freedesktop.org/drm/intel/issues/8303
Signed-off-by: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
---
 drivers/gpu/drm/i915/i915_drm_client.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drm_client.c b/drivers/gpu/drm/i915/i915_drm_client.c
index e8fa172ebe5e..d18d0a3ed905 100644
--- a/drivers/gpu/drm/i915/i915_drm_client.c
+++ b/drivers/gpu/drm/i915/i915_drm_client.c
@@ -147,11 +147,7 @@ void i915_drm_client_fdinfo(struct seq_file *m, struct file *f)
 		   PCI_SLOT(pdev->devfn), PCI_FUNC(pdev->devfn));
 	seq_printf(m, "drm-client-id:\t%u\n", client->id);
 
-	/*
-	 * Temporarily skip showing client engine information with GuC submission till
-	 * fetching engine busyness is implemented in the GuC submission backend
-	 */
-	if (GRAPHICS_VER(i915) < 8 || intel_uc_uses_guc_submission(&i915->gt0.uc))
+	if (GRAPHICS_VER(i915) < 8)
 		return;
 
 	for (i = 0; i < ARRAY_SIZE(uabi_class_names); i++)
-- 
2.36.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Intel-gfx] [PATCH] drm/i915/fdinfo: Enable fdinfo for GuC backends
  2023-04-03 10:21 ` Tvrtko Ursulin
@ 2023-04-03 20:10   ` Umesh Nerlige Ramappa
  0 siblings, 0 replies; 4+ messages in thread
From: Umesh Nerlige Ramappa @ 2023-04-03 20:10 UTC (permalink / raw)
  To: Tvrtko Ursulin; +Cc: intel-gfx

On Mon, Apr 03, 2023 at 11:21:51AM +0100, Tvrtko Ursulin wrote:
>
>On 31/03/2023 21:02, Umesh Nerlige Ramappa wrote:
>>The underlying mechanism used to provide the client specific utilization
>>in fdinfo is context busyness. When a context switches out, the HW
>>records the runtime in the specific context field. This information is
>>accumulated in fdinfo. This information is independent of the scheduling
>>backend as long as contexts are switching out in reasonable time.
>>
>>If a context is actively running on the engine, then the active busyness
>>is calculated by using the delta between current time and the context
>>switch in time. This part of the calculation depends on the scheduling
>>backend. For GuC backends, this data comes entirely from GuC FW. The FW
>>implementation is WIP.
>>
>>Enable fdinfo for GuC based platforms with the exception that long
>>running contexts will not provide reliable busyness data unless they
>>switch out at some reasonable point in time.
>>
>>Revert "drm/i915: Don't show engine information in fdinfo with GuC submission"
>>This reverts commit 8d0e3decf26bc423d8b1c42c05636ccc05ea6b17.
>>
>>Resolves: https://gitlab.freedesktop.org/drm/intel/issues/8303
>>Signed-off-by: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
>>Test-with: 20230331195915.5839-1-umesh.nerlige.ramappa@intel.com
>>---
>>  drivers/gpu/drm/i915/i915_drm_client.c | 6 +-----
>>  1 file changed, 1 insertion(+), 5 deletions(-)
>>
>>diff --git a/drivers/gpu/drm/i915/i915_drm_client.c b/drivers/gpu/drm/i915/i915_drm_client.c
>>index e8fa172ebe5e..d18d0a3ed905 100644
>>--- a/drivers/gpu/drm/i915/i915_drm_client.c
>>+++ b/drivers/gpu/drm/i915/i915_drm_client.c
>>@@ -147,11 +147,7 @@ void i915_drm_client_fdinfo(struct seq_file *m, struct file *f)
>>  		   PCI_SLOT(pdev->devfn), PCI_FUNC(pdev->devfn));
>>  	seq_printf(m, "drm-client-id:\t%u\n", client->id);
>>-	/*
>>-	 * Temporarily skip showing client engine information with GuC submission till
>>-	 * fetching engine busyness is implemented in the GuC submission backend
>>-	 */
>>-	if (GRAPHICS_VER(i915) < 8 || intel_uc_uses_guc_submission(&i915->gt0.uc))
>>+	if (GRAPHICS_VER(i915) < 8)
>>  		return;
>>  	for (i = 0; i < ARRAY_SIZE(uabi_class_names); i++)
>
>Ack in principle but we have to figure out why Kurt reports this 
>doesn't work - usage always zero with real workloads.

Hmm, looks like this might need some more changes that I initially 
thought. The changes may need to be extracted from this - 
https://patchwork.freedesktop.org/patch/496441/

lrc_update_runtime (which updates the stats by peeking into the hw 
context), is only called when the context is about to be unpinned. The 
issue is that the GuC context is not unpinned until the context 
scheduling is disabled. Disabling the context scheduling is asynchronous 
and does not align with context switch out. Also if requests are 
scheduled frequently to the context, then the context scheduling is 
never disabled.

In the patch linked above, I am calling lrc_update_runtime whenever the 
update_stats hook is called (in case of intel_gpu_top, it's every 
second) and when context is inactive. This resolves the issue, but I 
need to check with Ashutosh/John if we can do that for this specific 
case because the way we check that the context is active is dependent on 
the WIP feature of GuC.. sigh...

Regards,
Umesh
>
>Regards,
>
>Tvrtko

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Intel-gfx] [PATCH] drm/i915/fdinfo: Enable fdinfo for GuC backends
  2023-03-31 20:02 Umesh Nerlige Ramappa
@ 2023-04-03 10:21 ` Tvrtko Ursulin
  2023-04-03 20:10   ` Umesh Nerlige Ramappa
  0 siblings, 1 reply; 4+ messages in thread
From: Tvrtko Ursulin @ 2023-04-03 10:21 UTC (permalink / raw)
  To: Umesh Nerlige Ramappa, intel-gfx


On 31/03/2023 21:02, Umesh Nerlige Ramappa wrote:
> The underlying mechanism used to provide the client specific utilization
> in fdinfo is context busyness. When a context switches out, the HW
> records the runtime in the specific context field. This information is
> accumulated in fdinfo. This information is independent of the scheduling
> backend as long as contexts are switching out in reasonable time.
> 
> If a context is actively running on the engine, then the active busyness
> is calculated by using the delta between current time and the context
> switch in time. This part of the calculation depends on the scheduling
> backend. For GuC backends, this data comes entirely from GuC FW. The FW
> implementation is WIP.
> 
> Enable fdinfo for GuC based platforms with the exception that long
> running contexts will not provide reliable busyness data unless they
> switch out at some reasonable point in time.
> 
> Revert "drm/i915: Don't show engine information in fdinfo with GuC submission"
> This reverts commit 8d0e3decf26bc423d8b1c42c05636ccc05ea6b17.
> 
> Resolves: https://gitlab.freedesktop.org/drm/intel/issues/8303
> Signed-off-by: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
> Test-with: 20230331195915.5839-1-umesh.nerlige.ramappa@intel.com
> ---
>   drivers/gpu/drm/i915/i915_drm_client.c | 6 +-----
>   1 file changed, 1 insertion(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_drm_client.c b/drivers/gpu/drm/i915/i915_drm_client.c
> index e8fa172ebe5e..d18d0a3ed905 100644
> --- a/drivers/gpu/drm/i915/i915_drm_client.c
> +++ b/drivers/gpu/drm/i915/i915_drm_client.c
> @@ -147,11 +147,7 @@ void i915_drm_client_fdinfo(struct seq_file *m, struct file *f)
>   		   PCI_SLOT(pdev->devfn), PCI_FUNC(pdev->devfn));
>   	seq_printf(m, "drm-client-id:\t%u\n", client->id);
>   
> -	/*
> -	 * Temporarily skip showing client engine information with GuC submission till
> -	 * fetching engine busyness is implemented in the GuC submission backend
> -	 */
> -	if (GRAPHICS_VER(i915) < 8 || intel_uc_uses_guc_submission(&i915->gt0.uc))
> +	if (GRAPHICS_VER(i915) < 8)
>   		return;
>   
>   	for (i = 0; i < ARRAY_SIZE(uabi_class_names); i++)

Ack in principle but we have to figure out why Kurt reports this doesn't 
work - usage always zero with real workloads.

Regards,

Tvrtko

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Intel-gfx] [PATCH] drm/i915/fdinfo: Enable fdinfo for GuC backends
@ 2023-03-31 20:02 Umesh Nerlige Ramappa
  2023-04-03 10:21 ` Tvrtko Ursulin
  0 siblings, 1 reply; 4+ messages in thread
From: Umesh Nerlige Ramappa @ 2023-03-31 20:02 UTC (permalink / raw)
  To: intel-gfx

The underlying mechanism used to provide the client specific utilization
in fdinfo is context busyness. When a context switches out, the HW
records the runtime in the specific context field. This information is
accumulated in fdinfo. This information is independent of the scheduling
backend as long as contexts are switching out in reasonable time.

If a context is actively running on the engine, then the active busyness
is calculated by using the delta between current time and the context
switch in time. This part of the calculation depends on the scheduling
backend. For GuC backends, this data comes entirely from GuC FW. The FW
implementation is WIP.

Enable fdinfo for GuC based platforms with the exception that long
running contexts will not provide reliable busyness data unless they
switch out at some reasonable point in time.

Revert "drm/i915: Don't show engine information in fdinfo with GuC submission"
This reverts commit 8d0e3decf26bc423d8b1c42c05636ccc05ea6b17.

Resolves: https://gitlab.freedesktop.org/drm/intel/issues/8303
Signed-off-by: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
Test-with: 20230331195915.5839-1-umesh.nerlige.ramappa@intel.com
---
 drivers/gpu/drm/i915/i915_drm_client.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drm_client.c b/drivers/gpu/drm/i915/i915_drm_client.c
index e8fa172ebe5e..d18d0a3ed905 100644
--- a/drivers/gpu/drm/i915/i915_drm_client.c
+++ b/drivers/gpu/drm/i915/i915_drm_client.c
@@ -147,11 +147,7 @@ void i915_drm_client_fdinfo(struct seq_file *m, struct file *f)
 		   PCI_SLOT(pdev->devfn), PCI_FUNC(pdev->devfn));
 	seq_printf(m, "drm-client-id:\t%u\n", client->id);
 
-	/*
-	 * Temporarily skip showing client engine information with GuC submission till
-	 * fetching engine busyness is implemented in the GuC submission backend
-	 */
-	if (GRAPHICS_VER(i915) < 8 || intel_uc_uses_guc_submission(&i915->gt0.uc))
+	if (GRAPHICS_VER(i915) < 8)
 		return;
 
 	for (i = 0; i < ARRAY_SIZE(uabi_class_names); i++)
-- 
2.36.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-04-03 20:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-31 20:01 [Intel-gfx] [PATCH] drm/i915/fdinfo: Enable fdinfo for GuC backends Umesh Nerlige Ramappa
2023-03-31 20:02 Umesh Nerlige Ramappa
2023-04-03 10:21 ` Tvrtko Ursulin
2023-04-03 20:10   ` Umesh Nerlige Ramappa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).