Skip to contentSkip to conversation

drm/scheduler: Change scheduled fence track

PATCH In review Roy Sun 7 participants 15 messages Apr 26, 2021 – May 5, 2021

Subsystems (4)
lore
Share & tools
lore

Roy Sun

author
#0 lore raw

PATCH 1/2 drm/scheduler: Change scheduled fence track

Update the timestamp of scheduled fence on HW
completion of the previous fences

This allow more accurate tracking of the fence
execution in HW

---
 drivers/gpu/drm/scheduler/sched_main.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
drivers/gpu/drm/scheduler/sched_main.c +2 -2
index 92d8de24d0a1..f8e39ab0c41b 100644
@@ -515,7 +515,7 @@ void drm_sched_resubmit_jobs(struct drm_gpu_scheduler *sched)
 EXPORT_SYMBOL(drm_sched_resubmit_jobs);
 
 /**
- * drm_sched_resubmit_jobs_ext - helper to relunch certain number of jobs from mirror ring list
+ * drm_sched_resubmit_jobs_ext - helper to relaunch certain number of jobs from pending list
  *
  * @sched: scheduler instance
  * @max: job numbers to relaunch
@@ -671,7 +671,7 @@ drm_sched_select_entity(struct drm_gpu_scheduler *sched)
 static struct drm_sched_job *
 drm_sched_get_cleanup_job(struct drm_gpu_scheduler *sched)
 {
-	struct drm_sched_job *job;
+	struct drm_sched_job *job, *next;
 
 	/*
 	 * Don't destroy jobs while the timeout worker is running  OR thread
@@ -690,6 +690,14 @@ drm_sched_get_cleanup_job(struct drm_gpu_scheduler *sched)
 	if (job && dma_fence_is_signaled(&job->s_fence->finished)) {
 		/* remove job from pending_list */
 		list_del_init(&job->list);

We just need to record the scheduled time of the next job. So we need not to check the rest job.
+ /* account for the next fence in the queue */
+ next = list_first_entry_or_null(&sched->pending_list,
+ struct drm_sched_job, list);
+ if (next && test_bit(DMA_FENCE_FLAG_TIMESTAMP_BIT,
+ &job->s_fence->finished.flags)) {
+ next->s_fence->scheduled.timestamp =
+ job->s_fence->finished.timestamp;
+ }
} else {
job = NULL;
/* queue timeout for next job */

Signature · 6 lines
2.31.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
author
#1 lore raw

PATCH 2/2 drm/amdgpu: Add show_fdinfo() interface

Tracking devices, process info and fence info using /proc/pid/fdinfo

---
 drivers/gpu/drm/amd/amdgpu/Makefile        |   2 +
 drivers/gpu/drm/amd/amdgpu/amdgpu.h        |   1 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c    |  61 ++++++++++++
 drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.h    |   5 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c    |   5 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_fdinfo.c | 104 +++++++++++++++++++++
 drivers/gpu/drm/amd/amdgpu/amdgpu_fdinfo.h |  43 +++++++++
 drivers/gpu/drm/amd/amdgpu/amdgpu_object.c |  20 ++++
 drivers/gpu/drm/amd/amdgpu/amdgpu_object.h |   2 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c     |  45 +++++++++
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h     |   2 +
 11 files changed, 288 insertions(+), 2 deletions(-)
 create mode 100644 drivers/gpu/drm/amd/amdgpu/amdgpu_fdinfo.c
 create mode 100644 drivers/gpu/drm/amd/amdgpu/amdgpu_fdinfo.h
drivers/gpu/drm/amd/amdgpu/Makefile +2 -0
index ee85e8aba636..d216b7ecb5d1 100644
@@ -58,6 +58,8 @@ amdgpu-y += amdgpu_device.o amdgpu_kms.o \
 	amdgpu_umc.o smu_v11_0_i2c.o amdgpu_fru_eeprom.o amdgpu_rap.o \
 	amdgpu_fw_attestation.o amdgpu_securedisplay.o
 
+amdgpu-$(CONFIG_PROC_FS) += amdgpu_fdinfo.o
+
 amdgpu-$(CONFIG_PERF_EVENTS) += amdgpu_pmu.o
 
 # add asic specific block
drivers/gpu/drm/amd/amdgpu/amdgpu.h +1 -0
index 125b25a5ce5b..3365feae15e1 100644
@@ -107,6 +107,7 @@
 #include "amdgpu_gfxhub.h"
 #include "amdgpu_df.h"
 #include "amdgpu_smuio.h"
+#include "amdgpu_fdinfo.h"
 
 #define MAX_GPU_INSTANCE		16
 
drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c +61 -0

64 lines not on this page · raw message

drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.h +4 -1
index f54e10314661..10dcf59a5c6b 100644
@@ -87,5 +87,8 @@ void amdgpu_ctx_mgr_init(struct amdgpu_ctx_mgr *mgr);
 void amdgpu_ctx_mgr_entity_fini(struct amdgpu_ctx_mgr *mgr);
 long amdgpu_ctx_mgr_entity_flush(struct amdgpu_ctx_mgr *mgr, long timeout);
 void amdgpu_ctx_mgr_fini(struct amdgpu_ctx_mgr *mgr);
-
+ktime_t amdgpu_ctx_mgr_fence_usage(struct amdgpu_ctx_mgr *mgr, uint32_t hwip,
+		uint32_t idx, uint64_t *elapsed);
+void amdgpu_ctx_fence_time(struct amdgpu_ctx *ctx, struct amdgpu_ctx_entity *centity,
+		ktime_t *total, ktime_t *max);
 #endif
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +4 -1
index 0369d3532bf0..01603378dbc9 100644
@@ -42,7 +42,7 @@
 #include "amdgpu_irq.h"
 #include "amdgpu_dma_buf.h"
 #include "amdgpu_sched.h"
-
+#include "amdgpu_fdinfo.h"
 #include "amdgpu_amdkfd.h"
 
 #include "amdgpu_ras.h"
@@ -1692,6 +1692,9 @@ static const struct file_operations amdgpu_driver_kms_fops = {
 #ifdef CONFIG_COMPAT
 	.compat_ioctl = amdgpu_kms_compat_ioctl,
 #endif
+#ifdef CONFIG_PROC_FS
+	.show_fdinfo = amdgpu_show_fdinfo
+#endif
 };
 
 int amdgpu_file_to_fpriv(struct file *filp, struct amdgpu_fpriv **fpriv)
drivers/gpu/drm/amd/amdgpu/amdgpu_fdinfo.c new file +104 -0

104 lines not on this page · raw message

drivers/gpu/drm/amd/amdgpu/amdgpu_fdinfo.h new file +43 -0

43 lines not on this page · raw message

drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +20 -0
index da6d4ee0a132..745fcf3ea450 100644
@@ -1269,6 +1269,26 @@ void amdgpu_bo_move_notify(struct ttm_buffer_object *bo,
 	trace_amdgpu_bo_move(abo, new_mem->mem_type, old_mem->mem_type);
 }
 
+void amdgpu_bo_get_memory(struct amdgpu_bo *bo, uint64_t *vram_mem,
+				uint64_t *gtt_mem, uint64_t *cpu_mem)
+{
+	unsigned int domain;
+
+	domain = amdgpu_mem_type_to_domain(bo->tbo.mem.mem_type);
+	switch (domain) {
+	case AMDGPU_GEM_DOMAIN_VRAM:
+		*vram_mem += amdgpu_bo_size(bo);
+		break;
+	case AMDGPU_GEM_DOMAIN_GTT:
+		*gtt_mem += amdgpu_bo_size(bo);
+		break;
+	case AMDGPU_GEM_DOMAIN_CPU:
+	default:
+		*cpu_mem += amdgpu_bo_size(bo);
+		break;
+	}
+}
+
 /**
  * amdgpu_bo_release_notify - notification about a BO being released
  * @bo: pointer to a buffer object
drivers/gpu/drm/amd/amdgpu/amdgpu_object.h +2 -0
index e0ec48d6a3fd..456e6d09bc98 100644
@@ -307,6 +307,8 @@ int amdgpu_bo_sync_wait(struct amdgpu_bo *bo, void *owner, bool intr);
 u64 amdgpu_bo_gpu_offset(struct amdgpu_bo *bo);
 u64 amdgpu_bo_gpu_offset_no_check(struct amdgpu_bo *bo);
 int amdgpu_bo_validate(struct amdgpu_bo *bo);
+void amdgpu_bo_get_memory(struct amdgpu_bo *bo, uint64_t *vram_mem,
+				uint64_t *gtt_mem, uint64_t *cpu_mem);
 int amdgpu_bo_restore_shadow(struct amdgpu_bo *shadow,
 			     struct dma_fence **fence);
 uint32_t amdgpu_bo_get_preferred_pin_domain(struct amdgpu_device *adev,
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +45 -0

57 lines not on this page · raw message

drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h +2 -0
index e5a3f18be2b7..ea60ec122b51 100644
@@ -454,6 +454,8 @@ void amdgpu_vm_set_task_info(struct amdgpu_vm *vm);
 void amdgpu_vm_move_to_lru_tail(struct amdgpu_device *adev,
 				struct amdgpu_vm *vm);
 void amdgpu_vm_del_from_lru_notify(struct ttm_buffer_object *bo);
+void amdgpu_vm_get_memory(struct amdgpu_vm *vm, uint64_t *vram_mem,
+				uint64_t *gtt_mem, uint64_t *cpu_mem);
 
 #if defined(CONFIG_DEBUG_FS)
 void amdgpu_debugfs_vm_bo_info(struct amdgpu_vm *vm, struct seq_file *m);
Signature · 6 lines
2.31.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#2 lore raw
In reply to Roy Sun

Hey Alex,

any objections that we merge those two patches through drm-misc-next?

Thanks,
Christian.

Am 26.04.21 um 08:27 schrieb Roy Sun:

Quoted 41 lines

Update the timestamp of scheduled fence on HW
completion of the previous fences

This allow more accurate tracking of the fence
execution in HW

---
  drivers/gpu/drm/scheduler/sched_main.c | 12 ++++++++++--
  1 file changed, 10 insertions(+), 2 deletions(-)
drivers/gpu/drm/scheduler/sched_main.c +2 -2
index 92d8de24d0a1..f8e39ab0c41b 100644
@@ -515,7 +515,7 @@ void drm_sched_resubmit_jobs(struct drm_gpu_scheduler *sched)
  EXPORT_SYMBOL(drm_sched_resubmit_jobs);
 
  /**
- * drm_sched_resubmit_jobs_ext - helper to relunch certain number of jobs from mirror ring list
+ * drm_sched_resubmit_jobs_ext - helper to relaunch certain number of jobs from pending list
   *
   * @sched: scheduler instance
   * @max: job numbers to relaunch
@@ -671,7 +671,7 @@ drm_sched_select_entity(struct drm_gpu_scheduler *sched)
  static struct drm_sched_job *
  drm_sched_get_cleanup_job(struct drm_gpu_scheduler *sched)
  {
-	struct drm_sched_job *job;
+	struct drm_sched_job *job, *next;
 
  	/*
  	 * Don't destroy jobs while the timeout worker is running  OR thread
@@ -690,6 +690,14 @@ drm_sched_get_cleanup_job(struct drm_gpu_scheduler *sched)
  	if (job && dma_fence_is_signaled(&job->s_fence->finished)) {
  		/* remove job from pending_list */
  		list_del_init(&job->list);

We just need to record the scheduled time of the next job. So we need not to check the rest job.

drivers/gpu/drm/scheduler/sched_main.c +1 -0
+		/* account for the next fence in the queue */

drivers/gpu/drm/scheduler/sched_main.c

Quoted 10 lines
drivers/gpu/drm/scheduler/sched_main.c +7 -0
+		next = list_first_entry_or_null(&sched->pending_list,
+				struct drm_sched_job, list);
+		if (next && test_bit(DMA_FENCE_FLAG_TIMESTAMP_BIT,
+			&job->s_fence->finished.flags)) {
+			next->s_fence->scheduled.timestamp =
+				job->s_fence->finished.timestamp;
+		}
  	} else {
  		job = NULL;
  		/* queue timeout for next job */

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Reviewed-by on v1 1/2
#13 lore raw
In reply to Roy Sun

[AMD Official Use Only - Internal Distribution Only]

________________________________
From: amd-gfx <[email protected]> on behalf of Roy Sun <[email protected]>
Sent: Monday, April 26, 2021 2:27 PM
To: [email protected] <[email protected]>
Cc: Sun, Roy <[email protected]>; Nieto, David M <[email protected]>
Subject: [PATCH 1/2] drm/scheduler: Change scheduled fence track

Update the timestamp of scheduled fence on HW
completion of the previous fences

This allow more accurate tracking of the fence
execution in HW

---
 drivers/gpu/drm/scheduler/sched_main.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
drivers/gpu/drm/scheduler/sched_main.c +2 -2
index 92d8de24d0a1..f8e39ab0c41b 100644
@@ -515,7 +515,7 @@ void drm_sched_resubmit_jobs(struct drm_gpu_scheduler *sched)
 EXPORT_SYMBOL(drm_sched_resubmit_jobs);
 
 /**
- * drm_sched_resubmit_jobs_ext - helper to relunch certain number of jobs from mirror ring list
+ * drm_sched_resubmit_jobs_ext - helper to relaunch certain number of jobs from pending list
  *
  * @sched: scheduler instance
  * @max: job numbers to relaunch
@@ -671,7 +671,7 @@ drm_sched_select_entity(struct drm_gpu_scheduler *sched)
 static struct drm_sched_job *
 drm_sched_get_cleanup_job(struct drm_gpu_scheduler *sched)
 {
-       struct drm_sched_job *job;
+       struct drm_sched_job *job, *next;
 
         /*
          * Don't destroy jobs while the timeout worker is running  OR thread
@@ -690,6 +690,14 @@ drm_sched_get_cleanup_job(struct drm_gpu_scheduler *sched)
         if (job && dma_fence_is_signaled(&job->s_fence->finished)) {
                 /* remove job from pending_list */
                 list_del_init(&job->list);

We just need to record the scheduled time of the next job. So we need not to check the rest job.

[kevin]:
ok, it is fine for me with the timestamp flag check.

+ /* account for the next fence in the queue */
+ next = list_first_entry_or_null(&sched->pending_list,
+ struct drm_sched_job, list);
+ if (next && test_bit(DMA_FENCE_FLAG_TIMESTAMP_BIT,
+ &job->s_fence->finished.flags)) {
+ next->s_fence->scheduled.timestamp =
+ job->s_fence->finished.timestamp;
+ }

         } else {
                 job = NULL;
                 /* queue timeout for next job */

--
2.31.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=04%7C01%7CKevin1.Wang%40amd.com%7C0cebaf8d37e144c6b82108d9087c502e%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637550152295564379%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=Hdiil9BC2sp2pUI1121yZWELoCQqhDqTnbr7E9oVutw%3D&amp;reserved=0

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#14 lore raw

Am 26.04.21 um 17:30 schrieb Wang, Kevin(Yang):

Quoted 58 lines

[AMD Official Use Only - Internal Distribution Only]

------------------------------------------------------------------------
*From:* amd-gfx <[email protected]> on behalf of Roy Sun <[email protected]> *Sent:* Monday, April 26, 2021 2:27 PM
*To:* [email protected] <[email protected]>
*Cc:* Sun, Roy <[email protected]>; Nieto, David M <[email protected]> *Subject:* [PATCH 1/2] drm/scheduler: Change scheduled fence track
Update the timestamp of scheduled fence on HW
completion of the previous fences

This allow more accurate tracking of the fence
execution in HW

---
 drivers/gpu/drm/scheduler/sched_main.c | 12 ++++++++++--

 1 file changed, 10 insertions(+), 2 deletions(-)
drivers/gpu/drm/scheduler/sched_main.c +0 -1
index 92d8de24d0a1..f8e39ab0c41b 100644
@@ -515,7 +515,7 @@ void drm_sched_resubmit_jobs(struct 
 drm_gpu_scheduler *sched)
  EXPORT_SYMBOL(drm_sched_resubmit_jobs);
 
  /**
- * drm_sched_resubmit_jobs_ext - helper to relunch certain number of 

jobs from mirror ring list
+ * drm_sched_resubmit_jobs_ext - helper to relaunch certain number of jobs from pending list
  *
  * @sched: scheduler instance
  * @max: job numbers to relaunch

drivers/gpu/drm/scheduler/sched_main.c +0 -0
@@ -671,7 +671,7 @@ drm_sched_select_entity(struct drm_gpu_scheduler 
 *sched)

 static struct drm_sched_job * drm_sched_get_cleanup_job(struct drm_gpu_scheduler *sched) {
-       struct drm_sched_job *job;
+       struct drm_sched_job *job, *next;

         /*
          * Don't destroy jobs while the timeout worker is running  OR thread

drivers/gpu/drm/scheduler/sched_main.c +0 -0
@@ -690,6 +690,14 @@ drm_sched_get_cleanup_job(struct 
 drm_gpu_scheduler *sched)
          if (job && dma_fence_is_signaled(&job->s_fence->finished)) {
                  /* remove job from pending_list */
                  list_del_init(&job->list);

We just need to record the scheduled time of the next job. So we need not to check the rest job.

Quoted 3 lines

[kevin]:
ok, it is fine for me with the timestamp flag check.

Actually please drop that extra check.

The timestamp is guaranteed to be set on the next job or otherwise we wouldn't got here in the first place.

I've considered dropping the flag for quite a while and don't want any new users of this.

Christian.

Quoted 24 lines

+               /* account for the next fence in the queue */ +               next = list_first_entry_or_null(&sched->pending_list, +                               struct drm_sched_job, list); +               if (next && test_bit(DMA_FENCE_FLAG_TIMESTAMP_BIT,
+ &job->s_fence->finished.flags)) {
+ next->s_fence->scheduled.timestamp =
+ job->s_fence->finished.timestamp;
+               }
         } else {
                 job = NULL;
                 /* queue timeout for next job */

Signature · 11 lines
2.31.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=04%7C01%7CKevin1.Wang%40amd.com%7C0cebaf8d37e144c6b82108d9087c502e%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637550152295564379%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=Hdiil9BC2sp2pUI1121yZWELoCQqhDqTnbr7E9oVutw%3D&amp;reserved=0 <https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=04%7C01%7CKevin1.Wang%40amd.com%7C0cebaf8d37e144c6b82108d9087c502e%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637550152295564379%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=Hdiil9BC2sp2pUI1121yZWELoCQqhDqTnbr7E9oVutw%3D&amp;reserved=0>

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#3 lore raw
In reply to Christian König

[AMD Official Use Only - Internal Distribution Only]

No objections from me.

Thanks!

Alex

________________________________
From: Christian König <[email protected]>
Sent: Monday, April 26, 2021 2:49 AM
To: Deucher, Alexander <[email protected]>
Cc: Nieto, David M <[email protected]>; Sun, Roy <[email protected]>; amd-gfx list <[email protected]>
Subject: Re: [PATCH 1/2] drm/scheduler: Change scheduled fence track

Hey Alex,

any objections that we merge those two patches through drm-misc-next?

Thanks,
Christian.

Am 26.04.21 um 08:27 schrieb Roy Sun:

Quoted 41 lines

Update the timestamp of scheduled fence on HW
completion of the previous fences

This allow more accurate tracking of the fence
execution in HW

---
  drivers/gpu/drm/scheduler/sched_main.c | 12 ++++++++++--
  1 file changed, 10 insertions(+), 2 deletions(-)
drivers/gpu/drm/scheduler/sched_main.c +2 -2
index 92d8de24d0a1..f8e39ab0c41b 100644
@@ -515,7 +515,7 @@ void drm_sched_resubmit_jobs(struct drm_gpu_scheduler *sched)
  EXPORT_SYMBOL(drm_sched_resubmit_jobs);
 
  /**
- * drm_sched_resubmit_jobs_ext - helper to relunch certain number of jobs from mirror ring list
+ * drm_sched_resubmit_jobs_ext - helper to relaunch certain number of jobs from pending list
   *
   * @sched: scheduler instance
   * @max: job numbers to relaunch
@@ -671,7 +671,7 @@ drm_sched_select_entity(struct drm_gpu_scheduler *sched)
  static struct drm_sched_job *
  drm_sched_get_cleanup_job(struct drm_gpu_scheduler *sched)
  {
-     struct drm_sched_job *job;
+     struct drm_sched_job *job, *next;
 
       /*
        * Don't destroy jobs while the timeout worker is running  OR thread
@@ -690,6 +690,14 @@ drm_sched_get_cleanup_job(struct drm_gpu_scheduler *sched)
       if (job && dma_fence_is_signaled(&job->s_fence->finished)) {
               /* remove job from pending_list */
               list_del_init(&job->list);

We just need to record the scheduled time of the next job. So we need not to check the rest job.

drivers/gpu/drm/scheduler/sched_main.c +1 -0
+             /* account for the next fence in the queue */

drivers/gpu/drm/scheduler/sched_main.c

Quoted 10 lines
drivers/gpu/drm/scheduler/sched_main.c +7 -0
+             next = list_first_entry_or_null(&sched->pending_list,
+                             struct drm_sched_job, list);
+             if (next && test_bit(DMA_FENCE_FLAG_TIMESTAMP_BIT,
+                     &job->s_fence->finished.flags)) {
+                     next->s_fence->scheduled.timestamp =
+                             job->s_fence->finished.timestamp;
+             }
       } else {
               job = NULL;
               /* queue timeout for next job */

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#4 lore raw

[AMD Official Use Only - Internal Distribution Only]

That said, it would be easier for me to merge through the AMD tree since a relatively big AMD feature depends on it. Not sure how much conflict potential there is if this goes through the AMD tree.

Alex

________________________________
From: amd-gfx <[email protected]> on behalf of Deucher, Alexander <[email protected]>
Sent: Monday, April 26, 2021 3:24 PM
To: Christian König <[email protected]>
Cc: amd-gfx list <[email protected]>; Sun, Roy <[email protected]>; Nieto, David M <[email protected]>
Subject: Re: [PATCH 1/2] drm/scheduler: Change scheduled fence track

[AMD Official Use Only - Internal Distribution Only]

[AMD Official Use Only - Internal Distribution Only]

No objections from me.

Thanks!

Alex

________________________________
From: Christian König <[email protected]>
Sent: Monday, April 26, 2021 2:49 AM
To: Deucher, Alexander <[email protected]>
Cc: Nieto, David M <[email protected]>; Sun, Roy <[email protected]>; amd-gfx list <[email protected]>
Subject: Re: [PATCH 1/2] drm/scheduler: Change scheduled fence track

Hey Alex,

any objections that we merge those two patches through drm-misc-next?

Thanks,
Christian.

Am 26.04.21 um 08:27 schrieb Roy Sun:

Quoted 41 lines

Update the timestamp of scheduled fence on HW
completion of the previous fences

This allow more accurate tracking of the fence
execution in HW

---
  drivers/gpu/drm/scheduler/sched_main.c | 12 ++++++++++--
  1 file changed, 10 insertions(+), 2 deletions(-)
drivers/gpu/drm/scheduler/sched_main.c +2 -2
index 92d8de24d0a1..f8e39ab0c41b 100644
@@ -515,7 +515,7 @@ void drm_sched_resubmit_jobs(struct drm_gpu_scheduler *sched)
  EXPORT_SYMBOL(drm_sched_resubmit_jobs);
 
  /**
- * drm_sched_resubmit_jobs_ext - helper to relunch certain number of jobs from mirror ring list
+ * drm_sched_resubmit_jobs_ext - helper to relaunch certain number of jobs from pending list
   *
   * @sched: scheduler instance
   * @max: job numbers to relaunch
@@ -671,7 +671,7 @@ drm_sched_select_entity(struct drm_gpu_scheduler *sched)
  static struct drm_sched_job *
  drm_sched_get_cleanup_job(struct drm_gpu_scheduler *sched)
  {
-     struct drm_sched_job *job;
+     struct drm_sched_job *job, *next;
 
       /*
        * Don't destroy jobs while the timeout worker is running  OR thread
@@ -690,6 +690,14 @@ drm_sched_get_cleanup_job(struct drm_gpu_scheduler *sched)
       if (job && dma_fence_is_signaled(&job->s_fence->finished)) {
               /* remove job from pending_list */
               list_del_init(&job->list);

We just need to record the scheduled time of the next job. So we need not to check the rest job.

drivers/gpu/drm/scheduler/sched_main.c +1 -0
+             /* account for the next fence in the queue */

drivers/gpu/drm/scheduler/sched_main.c

Quoted 10 lines
drivers/gpu/drm/scheduler/sched_main.c +7 -0
+             next = list_first_entry_or_null(&sched->pending_list,
+                             struct drm_sched_job, list);
+             if (next && test_bit(DMA_FENCE_FLAG_TIMESTAMP_BIT,
+                     &job->s_fence->finished.flags)) {
+                     next->s_fence->scheduled.timestamp =
+                             job->s_fence->finished.timestamp;
+             }
       } else {
               job = NULL;
               /* queue timeout for next job */

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#5 lore raw

My concern is more to get this tested from more people than just AMD.

Christian.

Am 26.04.21 um 21:40 schrieb Deucher, Alexander:

Quoted 78 lines

[AMD Official Use Only - Internal Distribution Only]

That said, it would be easier for me to merge through the AMD tree since a relatively big AMD feature depends on it.  Not sure how much conflict potential there is if this goes through the AMD tree.

Alex

------------------------------------------------------------------------
*From:* amd-gfx <[email protected]> on behalf of Deucher, Alexander <[email protected]> *Sent:* Monday, April 26, 2021 3:24 PM
*To:* Christian König <[email protected]>
*Cc:* amd-gfx list <[email protected]>; Sun, Roy <[email protected]>; Nieto, David M <[email protected]> *Subject:* Re: [PATCH 1/2] drm/scheduler: Change scheduled fence track

[AMD Official Use Only - Internal Distribution Only]

[AMD Official Use Only - Internal Distribution Only]

No objections from me.

Thanks!

Alex

------------------------------------------------------------------------
*From:* Christian König <[email protected]>
*Sent:* Monday, April 26, 2021 2:49 AM
*To:* Deucher, Alexander <[email protected]>
*Cc:* Nieto, David M <[email protected]>; Sun, Roy <[email protected]>; amd-gfx list <[email protected]> *Subject:* Re: [PATCH 1/2] drm/scheduler: Change scheduled fence track
Hey Alex,

any objections that we merge those two patches through drm-misc-next?

Thanks,
Christian.

Am 26.04.21 um 08:27 schrieb Roy Sun:

Quoted 6 lines

Update the timestamp of scheduled fence on HW
completion of the previous fences

This allow more accurate tracking of the fence
execution in HW

Review

Quoted 7 lines

---
   drivers/gpu/drm/scheduler/sched_main.c | 12 ++++++++++--

   1 file changed, 10 insertions(+), 2 deletions(-)
(quoted diff) +0 -0

b/drivers/gpu/drm/scheduler/sched_main.c

drivers/gpu/drm/scheduler/sched_main.c void drm_sched_resubmit_jobs(struct

Quoted 4 lines

index 92d8de24d0a1..f8e39ab0c41b 100644

drivers/gpu/drm/scheduler/sched_main.c +0 -0
@@ -515,7 +515,7 @@ void drm_sched_resubmit_jobs(struct 

drm_gpu_scheduler *sched)

drivers/gpu/drm/scheduler/sched_main.c void drm_sched_resubmit_jobs(struct drm_gpu_scheduler *sched)

Quoted 4 lines
drivers/gpu/drm/scheduler/sched_main.c +0 -1
    EXPORT_SYMBOL(drm_sched_resubmit_jobs);
 
    /**
- * drm_sched_resubmit_jobs_ext - helper to relunch certain number 

of jobs from mirror ring list

drivers/gpu/drm/scheduler/sched_main.c void drm_sched_resubmit_jobs(struct · line 518

Quoted 1 line
drivers/gpu/drm/scheduler/sched_main.c +1 -0
+ * drm_sched_resubmit_jobs_ext - helper to relaunch certain number 

of jobs from pending list

drivers/gpu/drm/scheduler/sched_main.c drm_sched_select_entity(struct drm_gpu_scheduler

Quoted 4 lines
drivers/gpu/drm/scheduler/sched_main.c +0 -0
     *
     * @sched: scheduler instance
     * @max: job numbers to relaunch
@@ -671,7 +671,7 @@ drm_sched_select_entity(struct drm_gpu_scheduler 

*sched)

Quoted 6 lines

   static struct drm_sched_job * drm_sched_get_cleanup_job(struct drm_gpu_scheduler *sched) {
-     struct drm_sched_job *job;
+     struct drm_sched_job *job, *next;

Quoted 22 lines
Quoted 2 lines

        /*
         * Don't destroy jobs while the timeout worker is running  OR

thread

drivers/gpu/drm/scheduler/sched_main.c drm_sched_get_cleanup_job(struct

Quoted 1 line
drivers/gpu/drm/scheduler/sched_main.c +0 -0
@@ -690,6 +690,14 @@ drm_sched_get_cleanup_job(struct 

drm_gpu_scheduler *sched)

Quoted 16 lines
drivers/gpu/drm/scheduler/sched_main.c +0 -0
         if (job && dma_fence_is_signaled(&job->s_fence->finished)) {
                 /* remove job from pending_list */
 list_del_init(&job->list);

We just need to record the scheduled time of the next job. So we need not to check the rest job.
+             /* account for the next fence in the queue */ +             next = list_first_entry_or_null(&sched->pending_list, +                             struct drm_sched_job, list); +             if (next && test_bit(DMA_FENCE_FLAG_TIMESTAMP_BIT,
+ &job->s_fence->finished.flags)) {
+ next->s_fence->scheduled.timestamp =
+ job->s_fence->finished.timestamp;
+             }
        } else {
                job = NULL;
                /* queue timeout for next job */

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#6 lore raw

[AMD Official Use Only - Internal Distribution Only]

Fair point. Either way works for me.

Alex
________________________________
From: Christian König <[email protected]>
Sent: Monday, April 26, 2021 3:48 PM
To: Deucher, Alexander <[email protected]>
Cc: amd-gfx list <[email protected]>; Sun, Roy <[email protected]>; Nieto, David M <[email protected]>
Subject: Re: [PATCH 1/2] drm/scheduler: Change scheduled fence track

My concern is more to get this tested from more people than just AMD.

Christian.

Am 26.04.21 um 21:40 schrieb Deucher, Alexander:

[AMD Official Use Only - Internal Distribution Only]

That said, it would be easier for me to merge through the AMD tree since a relatively big AMD feature depends on it. Not sure how much conflict potential there is if this goes through the AMD tree.

Alex

________________________________
From: amd-gfx <[email protected]><mailto:[email protected]> on behalf of Deucher, Alexander <[email protected]><mailto:[email protected]>
Sent: Monday, April 26, 2021 3:24 PM
To: Christian König <[email protected]><mailto:[email protected]>
Cc: amd-gfx list <[email protected]><mailto:[email protected]>; Sun, Roy <[email protected]><mailto:[email protected]>; Nieto, David M <[email protected]><mailto:[email protected]>
Subject: Re: [PATCH 1/2] drm/scheduler: Change scheduled fence track

[AMD Official Use Only - Internal Distribution Only]

[AMD Official Use Only - Internal Distribution Only]

No objections from me.

Thanks!

Alex

________________________________
From: Christian König <[email protected]><mailto:[email protected]>
Sent: Monday, April 26, 2021 2:49 AM
To: Deucher, Alexander <[email protected]><mailto:[email protected]>
Cc: Nieto, David M <[email protected]><mailto:[email protected]>; Sun, Roy <[email protected]><mailto:[email protected]>; amd-gfx list <[email protected]><mailto:[email protected]>
Subject: Re: [PATCH 1/2] drm/scheduler: Change scheduled fence track

Hey Alex,

any objections that we merge those two patches through drm-misc-next?

Thanks,
Christian.

Am 26.04.21 um 08:27 schrieb Roy Sun:

Quoted 41 lines

Update the timestamp of scheduled fence on HW
completion of the previous fences

This allow more accurate tracking of the fence
execution in HW

---
  drivers/gpu/drm/scheduler/sched_main.c | 12 ++++++++++--
  1 file changed, 10 insertions(+), 2 deletions(-)
drivers/gpu/drm/scheduler/sched_main.c +2 -2
index 92d8de24d0a1..f8e39ab0c41b 100644
@@ -515,7 +515,7 @@ void drm_sched_resubmit_jobs(struct drm_gpu_scheduler *sched)
  EXPORT_SYMBOL(drm_sched_resubmit_jobs);
 
  /**
- * drm_sched_resubmit_jobs_ext - helper to relunch certain number of jobs from mirror ring list
+ * drm_sched_resubmit_jobs_ext - helper to relaunch certain number of jobs from pending list
   *
   * @sched: scheduler instance
   * @max: job numbers to relaunch
@@ -671,7 +671,7 @@ drm_sched_select_entity(struct drm_gpu_scheduler *sched)
  static struct drm_sched_job *
  drm_sched_get_cleanup_job(struct drm_gpu_scheduler *sched)
  {
-     struct drm_sched_job *job;
+     struct drm_sched_job *job, *next;
 
       /*
        * Don't destroy jobs while the timeout worker is running  OR thread
@@ -690,6 +690,14 @@ drm_sched_get_cleanup_job(struct drm_gpu_scheduler *sched)
       if (job && dma_fence_is_signaled(&job->s_fence->finished)) {
               /* remove job from pending_list */
               list_del_init(&job->list);

We just need to record the scheduled time of the next job. So we need not to check the rest job.

drivers/gpu/drm/scheduler/sched_main.c +1 -0
+             /* account for the next fence in the queue */

drivers/gpu/drm/scheduler/sched_main.c

Quoted 10 lines
drivers/gpu/drm/scheduler/sched_main.c +7 -0
+             next = list_first_entry_or_null(&sched->pending_list,
+                             struct drm_sched_job, list);
+             if (next && test_bit(DMA_FENCE_FLAG_TIMESTAMP_BIT,
+                     &job->s_fence->finished.flags)) {
+                     next->s_fence->scheduled.timestamp =
+                             job->s_fence->finished.timestamp;
+             }
       } else {
               job = NULL;
               /* queue timeout for next job */

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#7 lore raw

[AMD Official Use Only - Internal Distribution Only]

Hi Alex and Christian,
What extra work Roy need to do about this patch? And fdinfo?

Best wishes
Emily Deng
From: amd-gfx <[email protected]> On Behalf Of Deucher, Alexander
Sent: Tuesday, April 27, 2021 3:52 AM
To: Christian König <[email protected]>
Cc: Sun, Roy <[email protected]>; amd-gfx list <[email protected]>; Nieto, David M <[email protected]>
Subject: Re: [PATCH 1/2] drm/scheduler: Change scheduled fence track

[AMD Official Use Only - Internal Distribution Only]

[AMD Official Use Only - Internal Distribution Only]

Fair point. Either way works for me.

Alex
________________________________
From: Christian König <[email protected]<mailto:[email protected]>>
Sent: Monday, April 26, 2021 3:48 PM
To: Deucher, Alexander <[email protected]<mailto:[email protected]>>
Cc: amd-gfx list <[email protected]<mailto:[email protected]>>; Sun, Roy <[email protected]<mailto:[email protected]>>; Nieto, David M <[email protected]<mailto:[email protected]>>
Subject: Re: [PATCH 1/2] drm/scheduler: Change scheduled fence track

My concern is more to get this tested from more people than just AMD.

Christian.
Am 26.04.21 um 21:40 schrieb Deucher, Alexander:

[AMD Official Use Only - Internal Distribution Only]

That said, it would be easier for me to merge through the AMD tree since a relatively big AMD feature depends on it. Not sure how much conflict potential there is if this goes through the AMD tree.

Alex

________________________________
From: amd-gfx <[email protected]><mailto:[email protected]> on behalf of Deucher, Alexander <[email protected]><mailto:[email protected]>
Sent: Monday, April 26, 2021 3:24 PM
To: Christian König <[email protected]><mailto:[email protected]>
Cc: amd-gfx list <[email protected]><mailto:[email protected]>; Sun, Roy <[email protected]><mailto:[email protected]>; Nieto, David M <[email protected]><mailto:[email protected]>
Subject: Re: [PATCH 1/2] drm/scheduler: Change scheduled fence track

[AMD Official Use Only - Internal Distribution Only]

[AMD Official Use Only - Internal Distribution Only]

No objections from me.

Thanks!

Alex

________________________________
From: Christian König <[email protected]><mailto:[email protected]>
Sent: Monday, April 26, 2021 2:49 AM
To: Deucher, Alexander <[email protected]><mailto:[email protected]>
Cc: Nieto, David M <[email protected]><mailto:[email protected]>; Sun, Roy <[email protected]><mailto:[email protected]>; amd-gfx list <[email protected]><mailto:[email protected]>
Subject: Re: [PATCH 1/2] drm/scheduler: Change scheduled fence track

Hey Alex,

any objections that we merge those two patches through drm-misc-next?

Thanks,
Christian.

Am 26.04.21 um 08:27 schrieb Roy Sun:

Quoted 41 lines

Update the timestamp of scheduled fence on HW
completion of the previous fences

This allow more accurate tracking of the fence
execution in HW

---
  drivers/gpu/drm/scheduler/sched_main.c | 12 ++++++++++--
  1 file changed, 10 insertions(+), 2 deletions(-)
drivers/gpu/drm/scheduler/sched_main.c +2 -2
index 92d8de24d0a1..f8e39ab0c41b 100644
@@ -515,7 +515,7 @@ void drm_sched_resubmit_jobs(struct drm_gpu_scheduler *sched)
  EXPORT_SYMBOL(drm_sched_resubmit_jobs);
 
  /**
- * drm_sched_resubmit_jobs_ext - helper to relunch certain number of jobs from mirror ring list
+ * drm_sched_resubmit_jobs_ext - helper to relaunch certain number of jobs from pending list
   *
   * @sched: scheduler instance
   * @max: job numbers to relaunch
@@ -671,7 +671,7 @@ drm_sched_select_entity(struct drm_gpu_scheduler *sched)
  static struct drm_sched_job *
  drm_sched_get_cleanup_job(struct drm_gpu_scheduler *sched)
  {
-     struct drm_sched_job *job;
+     struct drm_sched_job *job, *next;
 
       /*
        * Don't destroy jobs while the timeout worker is running  OR thread
@@ -690,6 +690,14 @@ drm_sched_get_cleanup_job(struct drm_gpu_scheduler *sched)
       if (job && dma_fence_is_signaled(&job->s_fence->finished)) {
               /* remove job from pending_list */
               list_del_init(&job->list);

We just need to record the scheduled time of the next job. So we need not to check the rest job.

drivers/gpu/drm/scheduler/sched_main.c +1 -0
+             /* account for the next fence in the queue */

drivers/gpu/drm/scheduler/sched_main.c

Quoted 10 lines
drivers/gpu/drm/scheduler/sched_main.c +7 -0
+             next = list_first_entry_or_null(&sched->pending_list,
+                             struct drm_sched_job, list);
+             if (next && test_bit(DMA_FENCE_FLAG_TIMESTAMP_BIT,
+                     &job->s_fence->finished.flags)) {
+                     next->s_fence->scheduled.timestamp =
+                             job->s_fence->finished.timestamp;
+             }
       } else {
               job = NULL;
               /* queue timeout for next job */

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#8 lore raw

Well none. As I said I will push this upstream through drm-misc-next.

Christian.

Am 28.04.21 um 10:32 schrieb Deng, Emily:

Quoted 147 lines

[AMD Official Use Only - Internal Distribution Only]

Hi Alex and Christian,

What extra work Roy need to do about this patch? And fdinfo?

Best wishes

Emily Deng

*From:* amd-gfx <[email protected]> *On Behalf Of *Deucher, Alexander
*Sent:* Tuesday, April 27, 2021 3:52 AM
*To:* Christian König <[email protected]>
*Cc:* Sun, Roy <[email protected]>; amd-gfx list <[email protected]>; Nieto, David M <[email protected]> *Subject:* Re: [PATCH 1/2] drm/scheduler: Change scheduled fence track

[AMD Official Use Only - Internal Distribution Only]

[AMD Official Use Only - Internal Distribution Only]

Fair point. Either way works for me.

Alex

------------------------------------------------------------------------

*From:*Christian König <[email protected] <mailto:[email protected]>>
*Sent:* Monday, April 26, 2021 3:48 PM
*To:* Deucher, Alexander <[email protected] <mailto:[email protected]>>
*Cc:* amd-gfx list <[email protected] <mailto:[email protected]>>; Sun, Roy <[email protected] <mailto:[email protected]>>; Nieto, David M <[email protected] <mailto:[email protected]>> *Subject:* Re: [PATCH 1/2] drm/scheduler: Change scheduled fence track

My concern is more to get this tested from more people than just AMD.

Christian.

Am 26.04.21 um 21:40 schrieb Deucher, Alexander:

[AMD Official Use Only - Internal Distribution Only]

That said, it would be easier for me to merge through the AMD tree since a relatively big AMD feature depends on it.  Not sure how much conflict potential there is if this goes through the AMD tree.

Alex

------------------------------------------------------------------------

*From:*amd-gfx <[email protected]> <mailto:[email protected]> on behalf of Deucher, Alexander <[email protected]> <mailto:[email protected]>
*Sent:* Monday, April 26, 2021 3:24 PM
*To:* Christian König <[email protected]> <mailto:[email protected]>
*Cc:* amd-gfx list <[email protected]> <mailto:[email protected]>; Sun, Roy <[email protected]> <mailto:[email protected]>; Nieto, David M <[email protected]> <mailto:[email protected]>
*Subject:* Re: [PATCH 1/2] drm/scheduler: Change scheduled fence track

[AMD Official Use Only - Internal Distribution Only]

[AMD Official Use Only - Internal Distribution Only]

No objections from me.

Thanks!

Alex

------------------------------------------------------------------------

*From:*Christian König <[email protected]> <mailto:[email protected]>
*Sent:* Monday, April 26, 2021 2:49 AM
*To:* Deucher, Alexander <[email protected]> <mailto:[email protected]>
*Cc:* Nieto, David M <[email protected]> <mailto:[email protected]>; Sun, Roy <[email protected]> <mailto:[email protected]>; amd-gfx list <[email protected]> <mailto:[email protected]> *Subject:* Re: [PATCH 1/2] drm/scheduler: Change scheduled fence track

Hey Alex,

any objections that we merge those two patches through drm-misc-next?

Thanks,
Christian.

Am 26.04.21 um 08:27 schrieb Roy Sun:
> Update the timestamp of scheduled fence on HW
> completion of the previous fences
>
> This allow more accurate tracking of the fence
> execution in HW
>
> Signed-off-by: David M Nieto <[email protected]> <mailto:[email protected]>
> Signed-off-by: Roy Sun <[email protected]> <mailto:[email protected]> > ---
> drivers/gpu/drm/scheduler/sched_main.c | 12 ++++++++++-- >   1 file changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/scheduler/sched_main.c b/drivers/gpu/drm/scheduler/sched_main.c
> index 92d8de24d0a1..f8e39ab0c41b 100644
> --- a/drivers/gpu/drm/scheduler/sched_main.c
> +++ b/drivers/gpu/drm/scheduler/sched_main.c
> @@ -515,7 +515,7 @@ void drm_sched_resubmit_jobs(struct drm_gpu_scheduler *sched)
> EXPORT_SYMBOL(drm_sched_resubmit_jobs);
>
>   /**
> - * drm_sched_resubmit_jobs_ext - helper to relunch certain number of jobs from mirror ring list
> + * drm_sched_resubmit_jobs_ext - helper to relaunch certain number of jobs from pending list
>    *
>    * @sched: scheduler instance
>    * @max: job numbers to relaunch
> @@ -671,7 +671,7 @@ drm_sched_select_entity(struct drm_gpu_scheduler *sched)
>   static struct drm_sched_job *
> drm_sched_get_cleanup_job(struct drm_gpu_scheduler *sched) >   {
> -     struct drm_sched_job *job;
> +     struct drm_sched_job *job, *next;
>
>        /*
>         * Don't destroy jobs while the timeout worker is running OR thread
> @@ -690,6 +690,14 @@ drm_sched_get_cleanup_job(struct drm_gpu_scheduler *sched)
>        if (job && dma_fence_is_signaled(&job->s_fence->finished)) { >                /* remove job from pending_list */
> list_del_init(&job->list);
> We just need to record the scheduled time of the next job. So we > need not to check the rest job.
> +             /* account for the next fence in the queue */ > +             next = list_first_entry_or_null(&sched->pending_list, > + struct drm_sched_job, list);

Quoted 9 lines

> +             if (next && test_bit(DMA_FENCE_FLAG_TIMESTAMP_BIT, > + &job->s_fence->finished.flags)) {
> + next->s_fence->scheduled.timestamp =
> + job->s_fence->finished.timestamp;
> +             }
>        } else {
>                job = NULL;
>                /* queue timeout for next job */

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#9 lore raw

[AMD Official Use Only - Internal Distribution Only]

Hi Christian,
Good to know, thanks very much.

Best wishes
Emily Deng
From: Christian König <[email protected]>
Sent: Wednesday, April 28, 2021 5:07 PM
To: Deng, Emily <[email protected]>; Deucher, Alexander <[email protected]>
Cc: Sun, Roy <[email protected]>; amd-gfx list <[email protected]>; Nieto, David M <[email protected]>
Subject: Re: [PATCH 1/2] drm/scheduler: Change scheduled fence track

Well none. As I said I will push this upstream through drm-misc-next.

Christian.
Am 28.04.21 um 10:32 schrieb Deng, Emily:

[AMD Official Use Only - Internal Distribution Only]

Hi Alex and Christian,
What extra work Roy need to do about this patch? And fdinfo?

Best wishes
Emily Deng
From: amd-gfx <[email protected]><mailto:[email protected]> On Behalf Of Deucher, Alexander
Sent: Tuesday, April 27, 2021 3:52 AM
To: Christian König <[email protected]><mailto:[email protected]>
Cc: Sun, Roy <[email protected]><mailto:[email protected]>; amd-gfx list <[email protected]><mailto:[email protected]>; Nieto, David M <[email protected]><mailto:[email protected]>
Subject: Re: [PATCH 1/2] drm/scheduler: Change scheduled fence track

[AMD Official Use Only - Internal Distribution Only]

[AMD Official Use Only - Internal Distribution Only]

Fair point. Either way works for me.

Alex
________________________________
From: Christian König <[email protected]<mailto:[email protected]>>
Sent: Monday, April 26, 2021 3:48 PM
To: Deucher, Alexander <[email protected]<mailto:[email protected]>>
Cc: amd-gfx list <[email protected]<mailto:[email protected]>>; Sun, Roy <[email protected]<mailto:[email protected]>>; Nieto, David M <[email protected]<mailto:[email protected]>>
Subject: Re: [PATCH 1/2] drm/scheduler: Change scheduled fence track

My concern is more to get this tested from more people than just AMD.

Christian.
Am 26.04.21 um 21:40 schrieb Deucher, Alexander:

[AMD Official Use Only - Internal Distribution Only]

That said, it would be easier for me to merge through the AMD tree since a relatively big AMD feature depends on it. Not sure how much conflict potential there is if this goes through the AMD tree.

Alex

________________________________
From: amd-gfx <[email protected]><mailto:[email protected]> on behalf of Deucher, Alexander <[email protected]><mailto:[email protected]>
Sent: Monday, April 26, 2021 3:24 PM
To: Christian König <[email protected]><mailto:[email protected]>
Cc: amd-gfx list <[email protected]><mailto:[email protected]>; Sun, Roy <[email protected]><mailto:[email protected]>; Nieto, David M <[email protected]><mailto:[email protected]>
Subject: Re: [PATCH 1/2] drm/scheduler: Change scheduled fence track

[AMD Official Use Only - Internal Distribution Only]

[AMD Official Use Only - Internal Distribution Only]

No objections from me.

Thanks!

Alex

________________________________
From: Christian König <[email protected]><mailto:[email protected]>
Sent: Monday, April 26, 2021 2:49 AM
To: Deucher, Alexander <[email protected]><mailto:[email protected]>
Cc: Nieto, David M <[email protected]><mailto:[email protected]>; Sun, Roy <[email protected]><mailto:[email protected]>; amd-gfx list <[email protected]><mailto:[email protected]>
Subject: Re: [PATCH 1/2] drm/scheduler: Change scheduled fence track

Hey Alex,

any objections that we merge those two patches through drm-misc-next?

Thanks,
Christian.

Am 26.04.21 um 08:27 schrieb Roy Sun:

Quoted 41 lines

Update the timestamp of scheduled fence on HW
completion of the previous fences

This allow more accurate tracking of the fence
execution in HW

---
  drivers/gpu/drm/scheduler/sched_main.c | 12 ++++++++++--
  1 file changed, 10 insertions(+), 2 deletions(-)
drivers/gpu/drm/scheduler/sched_main.c +2 -2
index 92d8de24d0a1..f8e39ab0c41b 100644
@@ -515,7 +515,7 @@ void drm_sched_resubmit_jobs(struct drm_gpu_scheduler *sched)
  EXPORT_SYMBOL(drm_sched_resubmit_jobs);
 
  /**
- * drm_sched_resubmit_jobs_ext - helper to relunch certain number of jobs from mirror ring list
+ * drm_sched_resubmit_jobs_ext - helper to relaunch certain number of jobs from pending list
   *
   * @sched: scheduler instance
   * @max: job numbers to relaunch
@@ -671,7 +671,7 @@ drm_sched_select_entity(struct drm_gpu_scheduler *sched)
  static struct drm_sched_job *
  drm_sched_get_cleanup_job(struct drm_gpu_scheduler *sched)
  {
-     struct drm_sched_job *job;
+     struct drm_sched_job *job, *next;
 
       /*
        * Don't destroy jobs while the timeout worker is running  OR thread
@@ -690,6 +690,14 @@ drm_sched_get_cleanup_job(struct drm_gpu_scheduler *sched)
       if (job && dma_fence_is_signaled(&job->s_fence->finished)) {
               /* remove job from pending_list */
               list_del_init(&job->list);

We just need to record the scheduled time of the next job. So we need not to check the rest job.

drivers/gpu/drm/scheduler/sched_main.c +1 -0
+             /* account for the next fence in the queue */

drivers/gpu/drm/scheduler/sched_main.c

Quoted 10 lines
drivers/gpu/drm/scheduler/sched_main.c +7 -0
+             next = list_first_entry_or_null(&sched->pending_list,
+                             struct drm_sched_job, list);
+             if (next && test_bit(DMA_FENCE_FLAG_TIMESTAMP_BIT,
+                     &job->s_fence->finished.flags)) {
+                     next->s_fence->scheduled.timestamp =
+                             job->s_fence->finished.timestamp;
+             }
       } else {
               job = NULL;
               /* queue timeout for next job */

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#10 lore raw
In reply to Christian König

Did you push this yet? I don't see it in drm-misc.

Thanks,

Alex

Quoted 173 lines · Christian König

Well none. As I said I will push this upstream through drm-misc-next.

Christian.

Am 28.04.21 um 10:32 schrieb Deng, Emily:

[AMD Official Use Only - Internal Distribution Only]

Hi Alex and Christian,

What extra work Roy need to do about this patch? And fdinfo?

Best wishes

Emily Deng

From: amd-gfx <[email protected]> On Behalf Of Deucher, Alexander
Sent: Tuesday, April 27, 2021 3:52 AM
To: Christian König <[email protected]>
Cc: Sun, Roy <[email protected]>; amd-gfx list <[email protected]>; Nieto, David M <[email protected]>
Subject: Re: [PATCH 1/2] drm/scheduler: Change scheduled fence track

[AMD Official Use Only - Internal Distribution Only]

[AMD Official Use Only - Internal Distribution Only]

Fair point. Either way works for me.

Alex

________________________________

From: Christian König <[email protected]>
Sent: Monday, April 26, 2021 3:48 PM
To: Deucher, Alexander <[email protected]>
Cc: amd-gfx list <[email protected]>; Sun, Roy <[email protected]>; Nieto, David M <[email protected]>
Subject: Re: [PATCH 1/2] drm/scheduler: Change scheduled fence track

My concern is more to get this tested from more people than just AMD.

Christian.

Am 26.04.21 um 21:40 schrieb Deucher, Alexander:

[AMD Official Use Only - Internal Distribution Only]

That said, it would be easier for me to merge through the AMD tree since a relatively big AMD feature depends on it. Not sure how much conflict potential there is if this goes through the AMD tree.

Alex

________________________________

From: amd-gfx <[email protected]> on behalf of Deucher, Alexander <[email protected]>
Sent: Monday, April 26, 2021 3:24 PM
To: Christian König <[email protected]>
Cc: amd-gfx list <[email protected]>; Sun, Roy <[email protected]>; Nieto, David M <[email protected]>
Subject: Re: [PATCH 1/2] drm/scheduler: Change scheduled fence track

[AMD Official Use Only - Internal Distribution Only]

[AMD Official Use Only - Internal Distribution Only]

No objections from me.

Thanks!

Alex

________________________________

From: Christian König <[email protected]>
Sent: Monday, April 26, 2021 2:49 AM
To: Deucher, Alexander <[email protected]>
Cc: Nieto, David M <[email protected]>; Sun, Roy <[email protected]>; amd-gfx list <[email protected]>
Subject: Re: [PATCH 1/2] drm/scheduler: Change scheduled fence track

Hey Alex,

any objections that we merge those two patches through drm-misc-next?

Thanks,
Christian.

Am 26.04.21 um 08:27 schrieb Roy Sun:

Quoted 41 lines

Update the timestamp of scheduled fence on HW
completion of the previous fences

This allow more accurate tracking of the fence
execution in HW

---
  drivers/gpu/drm/scheduler/sched_main.c | 12 ++++++++++--
  1 file changed, 10 insertions(+), 2 deletions(-)
drivers/gpu/drm/scheduler/sched_main.c +2 -2
index 92d8de24d0a1..f8e39ab0c41b 100644
@@ -515,7 +515,7 @@ void drm_sched_resubmit_jobs(struct drm_gpu_scheduler *sched)
  EXPORT_SYMBOL(drm_sched_resubmit_jobs);
 
  /**
- * drm_sched_resubmit_jobs_ext - helper to relunch certain number of jobs from mirror ring list
+ * drm_sched_resubmit_jobs_ext - helper to relaunch certain number of jobs from pending list
   *
   * @sched: scheduler instance
   * @max: job numbers to relaunch
@@ -671,7 +671,7 @@ drm_sched_select_entity(struct drm_gpu_scheduler *sched)
  static struct drm_sched_job *
  drm_sched_get_cleanup_job(struct drm_gpu_scheduler *sched)
  {
-     struct drm_sched_job *job;
+     struct drm_sched_job *job, *next;
 
       /*
        * Don't destroy jobs while the timeout worker is running  OR thread
@@ -690,6 +690,14 @@ drm_sched_get_cleanup_job(struct drm_gpu_scheduler *sched)
       if (job && dma_fence_is_signaled(&job->s_fence->finished)) {
               /* remove job from pending_list */
               list_del_init(&job->list);

We just need to record the scheduled time of the next job. So we need not to check the rest job.

drivers/gpu/drm/scheduler/sched_main.c +1 -0
+             /* account for the next fence in the queue */

drivers/gpu/drm/scheduler/sched_main.c

Quoted 10 lines
drivers/gpu/drm/scheduler/sched_main.c +7 -0
+             next = list_first_entry_or_null(&sched->pending_list,
+                             struct drm_sched_job, list);
+             if (next && test_bit(DMA_FENCE_FLAG_TIMESTAMP_BIT,
+                     &job->s_fence->finished.flags)) {
+                     next->s_fence->scheduled.timestamp =
+                             job->s_fence->finished.timestamp;
+             }
       } else {
               job = NULL;
               /* queue timeout for next job */
Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#11 lore raw

I had to rebase them and was on sick leave last week.

Changed a few things on patch #1 and pushed the result a minute ago.

Christian.

Am 04.05.21 um 22:23 schrieb Alex Deucher:

Quoted 183 lines

Did you push this yet? I don't see it in drm-misc.

Thanks,

Alex

Quoted 175 lines · Christian König

Well none. As I said I will push this upstream through drm-misc-next.

Christian.

Am 28.04.21 um 10:32 schrieb Deng, Emily:

[AMD Official Use Only - Internal Distribution Only]

Hi Alex and Christian,

What extra work Roy need to do about this patch? And fdinfo?

Best wishes

Emily Deng

From: amd-gfx <[email protected]> On Behalf Of Deucher, Alexander
Sent: Tuesday, April 27, 2021 3:52 AM
To: Christian König <[email protected]>
Cc: Sun, Roy <[email protected]>; amd-gfx list <[email protected]>; Nieto, David M <[email protected]>
Subject: Re: [PATCH 1/2] drm/scheduler: Change scheduled fence track

[AMD Official Use Only - Internal Distribution Only]

[AMD Official Use Only - Internal Distribution Only]

Fair point. Either way works for me.

Alex

________________________________

From: Christian König <[email protected]>
Sent: Monday, April 26, 2021 3:48 PM
To: Deucher, Alexander <[email protected]>
Cc: amd-gfx list <[email protected]>; Sun, Roy <[email protected]>; Nieto, David M <[email protected]>
Subject: Re: [PATCH 1/2] drm/scheduler: Change scheduled fence track

My concern is more to get this tested from more people than just AMD.

Christian.

Am 26.04.21 um 21:40 schrieb Deucher, Alexander:

[AMD Official Use Only - Internal Distribution Only]

That said, it would be easier for me to merge through the AMD tree since a relatively big AMD feature depends on it. Not sure how much conflict potential there is if this goes through the AMD tree.

Alex

________________________________

From: amd-gfx <[email protected]> on behalf of Deucher, Alexander <[email protected]>
Sent: Monday, April 26, 2021 3:24 PM
To: Christian König <[email protected]>
Cc: amd-gfx list <[email protected]>; Sun, Roy <[email protected]>; Nieto, David M <[email protected]>
Subject: Re: [PATCH 1/2] drm/scheduler: Change scheduled fence track

[AMD Official Use Only - Internal Distribution Only]

[AMD Official Use Only - Internal Distribution Only]

No objections from me.

Thanks!

Alex

________________________________

From: Christian König <[email protected]>
Sent: Monday, April 26, 2021 2:49 AM
To: Deucher, Alexander <[email protected]>
Cc: Nieto, David M <[email protected]>; Sun, Roy <[email protected]>; amd-gfx list <[email protected]>
Subject: Re: [PATCH 1/2] drm/scheduler: Change scheduled fence track

Hey Alex,

any objections that we merge those two patches through drm-misc-next?

Thanks,
Christian.

Am 26.04.21 um 08:27 schrieb Roy Sun:

Quoted 41 lines

Update the timestamp of scheduled fence on HW
completion of the previous fences

This allow more accurate tracking of the fence
execution in HW

---
   drivers/gpu/drm/scheduler/sched_main.c | 12 ++++++++++--
   1 file changed, 10 insertions(+), 2 deletions(-)
drivers/gpu/drm/scheduler/sched_main.c +2 -2
index 92d8de24d0a1..f8e39ab0c41b 100644
@@ -515,7 +515,7 @@ void drm_sched_resubmit_jobs(struct drm_gpu_scheduler *sched)
   EXPORT_SYMBOL(drm_sched_resubmit_jobs);
 
   /**
- * drm_sched_resubmit_jobs_ext - helper to relunch certain number of jobs from mirror ring list
+ * drm_sched_resubmit_jobs_ext - helper to relaunch certain number of jobs from pending list
    *
    * @sched: scheduler instance
    * @max: job numbers to relaunch
@@ -671,7 +671,7 @@ drm_sched_select_entity(struct drm_gpu_scheduler *sched)
   static struct drm_sched_job *
   drm_sched_get_cleanup_job(struct drm_gpu_scheduler *sched)
   {
-     struct drm_sched_job *job;
+     struct drm_sched_job *job, *next;
 
        /*
         * Don't destroy jobs while the timeout worker is running  OR thread
@@ -690,6 +690,14 @@ drm_sched_get_cleanup_job(struct drm_gpu_scheduler *sched)
        if (job && dma_fence_is_signaled(&job->s_fence->finished)) {
                /* remove job from pending_list */
                list_del_init(&job->list);

We just need to record the scheduled time of the next job. So we need not to check the rest job.

drivers/gpu/drm/scheduler/sched_main.c +1 -0
+             /* account for the next fence in the queue */

drivers/gpu/drm/scheduler/sched_main.c

Quoted 10 lines
drivers/gpu/drm/scheduler/sched_main.c +7 -0
+             next = list_first_entry_or_null(&sched->pending_list,
+                             struct drm_sched_job, list);
+             if (next && test_bit(DMA_FENCE_FLAG_TIMESTAMP_BIT,
+                     &job->s_fence->finished.flags)) {
+                     next->s_fence->scheduled.timestamp =
+                             job->s_fence->finished.timestamp;
+             }
        } else {
                job = NULL;
                /* queue timeout for next job */

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#12 lore raw

[AMD Official Use Only - Internal Distribution Only]

Thanks,

Do we know when those changes will make it back to amd-staging-drm-next ?
________________________________
From: Christian König <[email protected]>
Sent: Wednesday, May 5, 2021 12:27 AM
To: Alex Deucher <[email protected]>
Cc: Deng, Emily <[email protected]>; Deucher, Alexander <[email protected]>; amd-gfx list <[email protected]>; Sun, Roy <[email protected]>; Nieto, David M <[email protected]>
Subject: Re: [PATCH 1/2] drm/scheduler: Change scheduled fence track

I had to rebase them and was on sick leave last week.

Changed a few things on patch #1 and pushed the result a minute ago.

Christian.

Am 04.05.21 um 22:23 schrieb Alex Deucher:

Quoted 183 lines

Did you push this yet? I don't see it in drm-misc.

Thanks,

Alex

Quoted 175 lines · Christian König

Well none. As I said I will push this upstream through drm-misc-next.

Christian.

Am 28.04.21 um 10:32 schrieb Deng, Emily:

[AMD Official Use Only - Internal Distribution Only]

Hi Alex and Christian,

What extra work Roy need to do about this patch? And fdinfo?

Best wishes

Emily Deng

From: amd-gfx <[email protected]> On Behalf Of Deucher, Alexander
Sent: Tuesday, April 27, 2021 3:52 AM
To: Christian König <[email protected]>
Cc: Sun, Roy <[email protected]>; amd-gfx list <[email protected]>; Nieto, David M <[email protected]>
Subject: Re: [PATCH 1/2] drm/scheduler: Change scheduled fence track

[AMD Official Use Only - Internal Distribution Only]

[AMD Official Use Only - Internal Distribution Only]

Fair point. Either way works for me.

Alex

________________________________

From: Christian König <[email protected]>
Sent: Monday, April 26, 2021 3:48 PM
To: Deucher, Alexander <[email protected]>
Cc: amd-gfx list <[email protected]>; Sun, Roy <[email protected]>; Nieto, David M <[email protected]>
Subject: Re: [PATCH 1/2] drm/scheduler: Change scheduled fence track

My concern is more to get this tested from more people than just AMD.

Christian.

Am 26.04.21 um 21:40 schrieb Deucher, Alexander:

[AMD Official Use Only - Internal Distribution Only]

That said, it would be easier for me to merge through the AMD tree since a relatively big AMD feature depends on it. Not sure how much conflict potential there is if this goes through the AMD tree.

Alex

________________________________

From: amd-gfx <[email protected]> on behalf of Deucher, Alexander <[email protected]>
Sent: Monday, April 26, 2021 3:24 PM
To: Christian König <[email protected]>
Cc: amd-gfx list <[email protected]>; Sun, Roy <[email protected]>; Nieto, David M <[email protected]>
Subject: Re: [PATCH 1/2] drm/scheduler: Change scheduled fence track

[AMD Official Use Only - Internal Distribution Only]

[AMD Official Use Only - Internal Distribution Only]

No objections from me.

Thanks!

Alex

________________________________

From: Christian König <[email protected]>
Sent: Monday, April 26, 2021 2:49 AM
To: Deucher, Alexander <[email protected]>
Cc: Nieto, David M <[email protected]>; Sun, Roy <[email protected]>; amd-gfx list <[email protected]>
Subject: Re: [PATCH 1/2] drm/scheduler: Change scheduled fence track

Hey Alex,

any objections that we merge those two patches through drm-misc-next?

Thanks,
Christian.

Am 26.04.21 um 08:27 schrieb Roy Sun:

Quoted 41 lines

Update the timestamp of scheduled fence on HW
completion of the previous fences

This allow more accurate tracking of the fence
execution in HW

---
   drivers/gpu/drm/scheduler/sched_main.c | 12 ++++++++++--
   1 file changed, 10 insertions(+), 2 deletions(-)
drivers/gpu/drm/scheduler/sched_main.c +2 -2
index 92d8de24d0a1..f8e39ab0c41b 100644
@@ -515,7 +515,7 @@ void drm_sched_resubmit_jobs(struct drm_gpu_scheduler *sched)
   EXPORT_SYMBOL(drm_sched_resubmit_jobs);
 
   /**
- * drm_sched_resubmit_jobs_ext - helper to relunch certain number of jobs from mirror ring list
+ * drm_sched_resubmit_jobs_ext - helper to relaunch certain number of jobs from pending list
    *
    * @sched: scheduler instance
    * @max: job numbers to relaunch
@@ -671,7 +671,7 @@ drm_sched_select_entity(struct drm_gpu_scheduler *sched)
   static struct drm_sched_job *
   drm_sched_get_cleanup_job(struct drm_gpu_scheduler *sched)
   {
-     struct drm_sched_job *job;
+     struct drm_sched_job *job, *next;
 
        /*
         * Don't destroy jobs while the timeout worker is running  OR thread
@@ -690,6 +690,14 @@ drm_sched_get_cleanup_job(struct drm_gpu_scheduler *sched)
        if (job && dma_fence_is_signaled(&job->s_fence->finished)) {
                /* remove job from pending_list */
                list_del_init(&job->list);

We just need to record the scheduled time of the next job. So we need not to check the rest job.

drivers/gpu/drm/scheduler/sched_main.c +1 -0
+             /* account for the next fence in the queue */

drivers/gpu/drm/scheduler/sched_main.c

Quoted 10 lines
drivers/gpu/drm/scheduler/sched_main.c +7 -0
+             next = list_first_entry_or_null(&sched->pending_list,
+                             struct drm_sched_job, list);
+             if (next && test_bit(DMA_FENCE_FLAG_TIMESTAMP_BIT,
+                     &job->s_fence->finished.flags)) {
+                     next->s_fence->scheduled.timestamp =
+                             job->s_fence->finished.timestamp;
+             }
        } else {
                job = NULL;
                /* queue timeout for next job */

_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=04%7C01%7CDavid.Nieto%40amd.com%7C7e7e640953954b94e2d408d90f9744a1%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637557964635531548%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=Yk2XfdFcbeimlcdh3VXWldS1cRD9LA32PMlN0kbfUME%3D&amp;reserved=0

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx