* [PATCH] drm/amd/amdgpu: remove redundant flush_delayed_work
@ 2021-01-18 2:47 Jingwen Chen
2021-01-18 8:42 ` Liu, Monk
2021-01-18 8:48 ` Christian König
0 siblings, 2 replies; 3+ messages in thread
From: Jingwen Chen @ 2021-01-18 2:47 UTC (permalink / raw)
To: amd-gfx; +Cc: Jingwen Chen
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.
Signed-off-by: Jingwen Chen <Jingwen.Chen2@amd.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
index 3e212862cf5d..c649944e49da 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
@@ -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
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply related [flat|nested] 3+ messages in thread
* RE: [PATCH] drm/amd/amdgpu: remove redundant flush_delayed_work
2021-01-18 2:47 [PATCH] drm/amd/amdgpu: remove redundant flush_delayed_work Jingwen Chen
@ 2021-01-18 8:42 ` Liu, Monk
2021-01-18 8:48 ` Christian König
1 sibling, 0 replies; 3+ messages in thread
From: Liu, Monk @ 2021-01-18 8:42 UTC (permalink / raw)
To: Chen, JingWen, amd-gfx@lists.freedesktop.org; +Cc: Chen, JingWen
[AMD Official Use Only - Internal Distribution Only]
Reviewed-by: Monk Liu <monk.liu@amd.com>
Thanks
------------------------------------------
Monk Liu | Cloud-GPU Core team
------------------------------------------
-----Original Message-----
From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of Jingwen Chen
Sent: Monday, January 18, 2021 10:47 AM
To: amd-gfx@lists.freedesktop.org
Cc: Chen, JingWen <JingWen.Chen2@amd.com>
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.
Signed-off-by: Jingwen Chen <Jingwen.Chen2@amd.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
index 3e212862cf5d..c649944e49da 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
@@ -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
amd-gfx@lists.freedesktop.org
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
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] drm/amd/amdgpu: remove redundant flush_delayed_work
2021-01-18 2:47 [PATCH] drm/amd/amdgpu: remove redundant flush_delayed_work Jingwen Chen
2021-01-18 8:42 ` Liu, Monk
@ 2021-01-18 8:48 ` Christian König
1 sibling, 0 replies; 3+ messages in thread
From: Christian König @ 2021-01-18 8:48 UTC (permalink / raw)
To: Jingwen Chen, amd-gfx
Am 18.01.21 um 03:47 schrieb Jingwen Chen:
> 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.
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.
>
> Signed-off-by: Jingwen Chen <Jingwen.Chen2@amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
> index 3e212862cf5d..c649944e49da 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
> @@ -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
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-01-18 8:49 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-01-18 2:47 [PATCH] drm/amd/amdgpu: remove redundant flush_delayed_work Jingwen Chen
2021-01-18 8:42 ` Liu, Monk
2021-01-18 8:48 ` Christian König
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox