drm/xe: Remove redundant rebind from preempt rebind worker
Subsystems (2)
Matthew Brost
maintainerPATCH 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
@@ -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
-----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_beginso no need to callxe_vm_rebindagain 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
Signed-off-by Matthew Brost <[email protected]>--- drivers/gpu/drm/xe/xe_vm.c | 4 ---- 1 file changed, 4 deletions(-)drivers/gpu/drm/xe/xe_vm.c +0
-4@@ -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
Matthew Brost
maintainerQuoted 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 workerQuoted 1 line
Quoted 7 lines
Quoted 2 lines
We issue a rebind in
xe_preempt_work_beginso no need to callxe_vm_rebindagain in the preempt rebind worker.The call to
xe_vm_rebindinxe_preempt_work_beginpasses arebind_workervalue of "false", whereas the call inpreempt_rebind_work_funcpasses arebind_workervalue 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 CavittQuoted 25 lines
Signed-off-by Matthew Brost <[email protected]>--- drivers/gpu/drm/xe/xe_vm.c | 4 ---- 1 file changed, 4 deletions(-)drivers/gpu/drm/xe/xe_vm.c +0
-4@@ -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
Cavitt, Jonathan
Reviewed-by-----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 workerQuoted 1 line
Quoted 7 lines
Quoted 2 lines
We issue a rebind in
xe_preempt_work_beginso no need to callxe_vm_rebindagain in the preempt rebind worker.The call to
xe_vm_rebindinxe_preempt_work_beginpasses arebind_workervalue of "false", whereas the call inpreempt_rebind_work_funcpasses arebind_workervalue 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_bindinxe_preempt_work_beginwith 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 CavittQuoted 25 lines
Signed-off-by Matthew Brost <[email protected]>--- drivers/gpu/drm/xe/xe_vm.c | 4 ---- 1 file changed, 4 deletions(-)drivers/gpu/drm/xe/xe_vm.c +0
-4@@ -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