drm/amd/amdgpu: remove redundant flush_delayed_work
Subsystems (2)
PATCH 1/1 drm/amd/amdgpu: remove redundant flush_delayed_work
When using cancel_delayed_work_sync, there's no need to flush_delayed_work first. This sequence can lead to a redundant loop of work executing.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c | 1 - 1 file changed, 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c +0 -1
@@ -569,7 +569,6 @@ void amdgpu_virt_fini_data_exchange(struct amdgpu_device *adev) {if (adev->virt.vf2pf_update_interval_ms !=0 ) {DRM_INFO ("clean up the vf2pf work item\n" ); -flush_delayed_work (&adev->virt.vf2pf_work);cancel_delayed_work_sync (&adev->virt.vf2pf_work); adev->virt.vf2pf_update_interval_ms =0 ; }
Signature · 6 lines
2.25.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[AMD Official Use Only - Internal Distribution Only]
Thanks
------------------------------------------
Monk Liu | Cloud-GPU Core team
------------------------------------------
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Jingwen Chen
Sent: Monday, January 18, 2021 10:47 AM
To: [email protected]
Cc: Chen, JingWen <[email protected]>
Subject: [PATCH] drm/amd/amdgpu: remove redundant flush_delayed_work
When using cancel_delayed_work_sync, there's no need to flush_delayed_work first. This sequence can lead to a redundant loop of work executing.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c | 1 - 1 file changed, 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c +0 -2
@@ -569,7 +569,6 @@ void amdgpu_virt_fini_data_exchange(struct amdgpu_device *adev) {if (adev->virt.vf2pf_update_interval_ms !=0 ) {DRM_INFO ("clean up the vf2pf work item\n" ); -flush_delayed_work (&adev->virt.vf2pf_work);cancel_delayed_work_sync (&adev->virt.vf2pf_work); adev->virt.vf2pf_update_interval_ms =0 ; } --
2.25.1
_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=04%7C01%7Cmonk.liu%40amd.com%7C959a668e79e44b56af7708d8bb5b7457%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637465348766384167%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=zr9WvU7%2B%2B3cx9O2Vb8nIFYa9PZAT7bFOkdecY%2FLXdMI%3D&reserved=0
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Am 18.01.21 um 03:47 schrieb Jingwen Chen:
Quoted 3 lines
When using
cancel_delayed_work_sync, there's no need toflush_delayed_workfirst. This sequence can lead to a redundant loop of work executing.
Well the difference is that cancel_delayed_work_sync() cancels the work when it is not running yet and waits for the work to finish if it is already running.
flush_delayed_work() always waits for the work to finish.
You need to remove the cancel_delayed_work_sync not the flush if you want to keep the functionality the same.
Regards,
Christian.
Quoted 11 lines
Signed-off-by Jingwen Chen <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c | 1 - 1 file changed, 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c +0
-0
drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c void amdgpu_virt_fini_data_exchange(struct amdgpu_device *adev) · line 574
Quoted 7 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c +0
-1@@ -569,7 +569,6 @@ void amdgpu_virt_fini_data_exchange(struct amdgpu_device *adev) {if (adev->virt.vf2pf_update_interval_ms !=0 ) {DRM_INFO ("clean up the vf2pf work item\n" ); -flush_delayed_work (&adev->virt.vf2pf_work);cancel_delayed_work_sync (&adev->virt.vf2pf_work); adev->virt.vf2pf_update_interval_ms =0 ; }
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx