Skip to contentSkip to conversation

drm/xe: Remove redundant rebind from preempt rebind worker

PATCH In review Matthew Brost 2 participants 4 messages Nov 12, 2024

Subsystems (2)
lore
Share & tools
lore

Matthew Brost

author maintainer
#0 lore raw

PATCH 1/1 drm/xe: Remove redundant rebind from preempt rebind worker

We issue a rebind in xe_preempt_work_begin so no need to call xe_vm_rebind again in the preempt rebind worker.

---
 drivers/gpu/drm/xe/xe_vm.c | 4 ----
 1 file changed, 4 deletions(-)
drivers/gpu/drm/xe/xe_vm.c +0 -4
index 624133fae5f5..756c72cd6048 100644
@@ -525,10 +525,6 @@ static void preempt_rebind_work_func(struct work_struct *w)
 	if (err)
 		goto out_unlock;
 
-	err = xe_vm_rebind(vm, true);
-	if (err)
-		goto out_unlock;
-
 	/* Wait on rebinds and munmap style VM unbinds */
 	wait = dma_resv_wait_timeout(xe_vm_resv(vm),
 				     DMA_RESV_USAGE_KERNEL,
Signature · 1 line
2.34.1
#1 lore raw

-----Original Message-----
From: Intel-xe <[email protected]> On Behalf Of Matthew Brost
Sent: Tuesday, November 12, 2024 1:41 PM
To: [email protected]
Subject: [PATCH] drm/xe: Remove redundant rebind from preempt rebind worker

Quoted 3 lines

We issue a rebind in xe_preempt_work_begin so no need to call xe_vm_rebind again in the preempt rebind worker.

The call to xe_vm_rebind in xe_preempt_work_begin passes a rebind_worker value of "false", whereas the call in preempt_rebind_work_func passes a rebind_worker value of "true". Ergo, I think the execution requirements are different enough to warrant two separate calls.

I could be wrong, though, so I won't nack.
-Jonathan Cavitt

Quoted 25 lines
---
 drivers/gpu/drm/xe/xe_vm.c | 4 ----
 1 file changed, 4 deletions(-)
drivers/gpu/drm/xe/xe_vm.c +0 -4
index 624133fae5f5..756c72cd6048 100644
@@ -525,10 +525,6 @@ static void preempt_rebind_work_func(struct work_struct *w)
 	if (err)
 		goto out_unlock;
 
-	err = xe_vm_rebind(vm, true);
-	if (err)
-		goto out_unlock;
-
 	/* Wait on rebinds and munmap style VM unbinds */
 	wait = dma_resv_wait_timeout(xe_vm_resv(vm),
 				     DMA_RESV_USAGE_KERNEL,
Signature · 1 line
2.34.1
author maintainer
#2 lore raw
Quoted 6 lines · Jonathan

-----Original Message-----
From: Intel-xe <[email protected]> On Behalf Of Matthew Brost
Sent: Tuesday, November 12, 2024 1:41 PM
To: [email protected]
Subject: [PATCH] drm/xe: Remove redundant rebind from preempt rebind worker

Quoted 1 line
Quoted 7 lines
Quoted 2 lines

We issue a rebind in xe_preempt_work_begin so no need to call xe_vm_rebind again in the preempt rebind worker.

The call to xe_vm_rebind in xe_preempt_work_begin passes a rebind_worker value of "false", whereas the call in preempt_rebind_work_func passes a rebind_worker value of "true". Ergo, I think the execution requirements are different enough to warrant two separate calls.

Hmm, this still doesn't look right but yea this patch also isn't right. Let mm follow up on way we doing it is this way. I think we should just call xe_vm_bind in xe_preempt_work_begin with a value of true unless I'm mistaken.

Matt

Quoted 28 lines

I could be wrong, though, so I won't nack.
-Jonathan Cavitt

Quoted 25 lines
---
 drivers/gpu/drm/xe/xe_vm.c | 4 ----
 1 file changed, 4 deletions(-)
drivers/gpu/drm/xe/xe_vm.c +0 -4
index 624133fae5f5..756c72cd6048 100644
@@ -525,10 +525,6 @@ static void preempt_rebind_work_func(struct work_struct *w)
 	if (err)
 		goto out_unlock;
 
-	err = xe_vm_rebind(vm, true);
-	if (err)
-		goto out_unlock;
-
 	/* Wait on rebinds and munmap style VM unbinds */
 	wait = dma_resv_wait_timeout(xe_vm_resv(vm),
 				     DMA_RESV_USAGE_KERNEL,
Signature · 1 line
2.34.1
Reviewed-by
#3 lore raw

-----Original Message-----
From: Brost, Matthew <[email protected]>
Sent: Tuesday, November 12, 2024 2:10 PM
To: Cavitt, Jonathan <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH] drm/xe: Remove redundant rebind from preempt rebind worker

Quoted 16 lines · Jonathan
Quoted 6 lines

-----Original Message-----
From: Intel-xe <[email protected]> On Behalf Of Matthew Brost
Sent: Tuesday, November 12, 2024 1:41 PM
To: [email protected]
Subject: [PATCH] drm/xe: Remove redundant rebind from preempt rebind worker

Quoted 1 line
Quoted 7 lines
Quoted 2 lines

We issue a rebind in xe_preempt_work_begin so no need to call xe_vm_rebind again in the preempt rebind worker.

The call to xe_vm_rebind in xe_preempt_work_begin passes a rebind_worker value of "false", whereas the call in preempt_rebind_work_func passes a rebind_worker value of "true". Ergo, I think the execution requirements are different enough to warrant two separate calls.

Quoted 4 lines

Hmm, this still doesn't look right but yea this patch also isn't right. Let mm follow up on way we doing it is this way. I think we should just call xe_vm_bind in xe_preempt_work_begin with a value of true unless I'm mistaken.

Okay, it sounds like the solution is as simple as changing the "false" to "true" in xe_preempt_work_begin on top of what we're doing here. It's probably more complicated than that, but if it somehow isn't, then you can add my Reviewed-by to the patch preemptively, as then the xe_vm_rebind in preempt_rebind_work_func would irrefutably be redundant.

-Jonathan Cavitt

Quoted 32 lines

Matt

Quoted 28 lines

I could be wrong, though, so I won't nack.
-Jonathan Cavitt

Quoted 25 lines
---
 drivers/gpu/drm/xe/xe_vm.c | 4 ----
 1 file changed, 4 deletions(-)
drivers/gpu/drm/xe/xe_vm.c +0 -4
index 624133fae5f5..756c72cd6048 100644
@@ -525,10 +525,6 @@ static void preempt_rebind_work_func(struct work_struct *w)
 	if (err)
 		goto out_unlock;
 
-	err = xe_vm_rebind(vm, true);
-	if (err)
-		goto out_unlock;
-
 	/* Wait on rebinds and munmap style VM unbinds */
 	wait = dma_resv_wait_timeout(xe_vm_resv(vm),
 				     DMA_RESV_USAGE_KERNEL,
Signature · 1 line
2.34.1