drm/amdkfd: Disable Packet Manager in non HWS mode except Hawaii
Subsystems (3)
PATCH 1/1 drm/amdkfd: Disable Packet Manager in non HWS mode except Hawaii
The packet manager is only needed for HWS mode, as well as Hawaii in non HWS mode. So only initialize it under those scenarios. This is useful especially for emulation environment when things are slow.
--- .../gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c +11 -2
@@ -911,13 +911,22 @@ static void uninitialize(struct device_queue_manager *dqm)static int start_nocpsch (struct device_queue_manager *dqm) { +int ret =0 ;init_interrupts (dqm); -return pm_init (&dqm->packets, dqm); +/* Cache flushing on Hawaii in non HWS mode is done through packet +* manager (PM), so we need to initialize PM for Hawaii. +*/ +if (dqm->dev->device_info->asic_family ==CHIP_HAWAII ) + ret =pm_init (&dqm->packets, dqm); + +return ret; }static int stop_nocpsch (struct device_queue_manager *dqm) { -pm_uninit (&dqm->packets); +if (dqm->dev->device_info->asic_family ==CHIP_HAWAII ) +pm_uninit (&dqm->packets); +return 0 ; }
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 3 lines · Yong
The packet manager is only needed for HWS mode, as well as Hawaii in non HWS mode. So only initialize it under those scenarios. This is useful especially for emulation environment when things are slow.
I never thought of packet manager initialization as something expensive. Why does this matter? In emulation, the GPU is slow, but the CPU should be OK. Packet manager initialization doesn't do any waiting for the GPU, so I don't see how this would have any measurable impact.
Anyway, see one cosmetic comment inline.
Quoted 12 lines
Change-Id Iedfa07c94241e3252463e1e5ea537543c2ccef03Signed-off-by Yong Zhao <[email protected]>--- .../gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c +0
-0
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c static void uninitialize(struct device_queue_manager *dqm) · line 914
Quoted 4 lines
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c +1
-0@@ -911,13 +911,22 @@ static void uninitialize(struct device_queue_manager *dqm)static int start_nocpsch (struct device_queue_manager *dqm) { +int ret =0 ;
checkpatch.pl would complain that there should be an empty line after variable declarations.
Quoted 10 lines
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c +7
-1init_interrupts (dqm); -return pm_init (&dqm->packets, dqm); +/* Cache flushing on Hawaii in non HWS mode is done through packet +* manager (PM), so we need to initialize PM for Hawaii. +*/ +if (dqm->dev->device_info->asic_family ==CHIP_HAWAII ) + ret =pm_init (&dqm->packets, dqm); + +return ret; }
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c static void uninitialize(struct device_queue_manager *dqm) · line 932
Quoted 10 lines
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c +3
-1static int stop_nocpsch (struct device_queue_manager *dqm) { -pm_uninit (&dqm->packets); +if (dqm->dev->device_info->asic_family ==CHIP_HAWAII ) +pm_uninit (&dqm->packets); +return 0 ; }
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): a1713067-fd8f-87b5-cfe5-82ed45ed8f23-5C7GfCeVMHo@public.gmane.org
I can fix that cosmetic line. I did not measure the difference, but driver initialization usually takes a longer time, that's why I am trying to reduce it. Also, it means one less thing to worry about during non HWS mode bringup, because we don't need to deal with HIQ any more. With that, what do you think now?
Regards,
Yong
Quoted 42 lines · Felix
Quoted 3 lines · Yong
The packet manager is only needed for HWS mode, as well as Hawaii in non HWS mode. So only initialize it under those scenarios. This is useful especially for emulation environment when things are slow.
I never thought of packet manager initialization as something expensive. Why does this matter? In emulation, the GPU is slow, but the CPU should be OK. Packet manager initialization doesn't do any waiting for the GPU, so I don't see how this would have any measurable impact.
Anyway, see one cosmetic comment inline.
Quoted 11 lines
Change-Id Iedfa07c94241e3252463e1e5ea537543c2ccef03Signed-off-by Yong Zhao <[email protected]>--- .../gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c +0
-0drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c static void uninitialize(struct device_queue_manager *dqm) · line 914
Quoted 4 lines
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c +1
-0@@ -911,13 +911,22 @@ static void uninitialize(struct device_queue_manager *dqm)static int start_nocpsch (struct device_queue_manager *dqm) { +int ret =0 ;checkpatch.pl would complain that there should be an empty line after variable declarations.
Quoted 11 lines
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c +7
-1init_interrupts (dqm); -return pm_init (&dqm->packets, dqm); +/* Cache flushing on Hawaii in non HWS mode is done through packet +* manager (PM), so we need to initialize PM for Hawaii. +*/ +if (dqm->dev->device_info->asic_family ==CHIP_HAWAII ) + ret =pm_init (&dqm->packets, dqm); + +return ret; }
Quoted 9 lines
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c static void uninitialize(struct device_queue_manager *dqm) · line 932
Quoted 9 lines
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c +3
-1static int stop_nocpsch (struct device_queue_manager *dqm) { -pm_uninit (&dqm->packets); +if (dqm->dev->device_info->asic_family ==CHIP_HAWAII ) +pm_uninit (&dqm->packets); +return 0 ; }
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): f22f11aa-ff44-1130-b058-1f125e957c97-5C7GfCeVMHo@public.gmane.org
If you want to optimize driver init time, you should check what actually takes the most time. Randomly micro-optimizing things that may not even matter only increases complexity for no benefit.
Typically the things that make initialization slow are points where we synchronize with the GPU or random sleeps or delays to allow the hardware to complete something. A few lines of code that only run on the CPU will not make an appreciable difference.
Regards,
Felix
Quoted 53 lines · Yong
I can fix that cosmetic line. I did not measure the difference, but driver initialization usually takes a longer time, that's why I am trying to reduce it. Also, it means one less thing to worry about during non HWS mode bringup, because we don't need to deal with HIQ any more. With that, what do you think now?
Regards,
Yong
Quoted 42 lines · Felix
Quoted 3 lines · Yong
The packet manager is only needed for HWS mode, as well as Hawaii in non HWS mode. So only initialize it under those scenarios. This is useful especially for emulation environment when things are slow.
I never thought of packet manager initialization as something expensive. Why does this matter? In emulation, the GPU is slow, but the CPU should be OK. Packet manager initialization doesn't do any waiting for the GPU, so I don't see how this would have any measurable impact.
Anyway, see one cosmetic comment inline.
Quoted 11 lines
Change-Id Iedfa07c94241e3252463e1e5ea537543c2ccef03Signed-off-by Yong Zhao <[email protected]>--- .../gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c +0
-0drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c static void uninitialize(struct device_queue_manager *dqm) · line 914
Quoted 4 lines
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c +1
-0@@ -911,13 +911,22 @@ static void uninitialize(struct device_queue_manager *dqm)static int start_nocpsch (struct device_queue_manager *dqm) { +int ret =0 ;checkpatch.pl would complain that there should be an empty line after variable declarations.
Quoted 11 lines
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c +7
-1init_interrupts (dqm); -return pm_init (&dqm->packets, dqm); +/* Cache flushing on Hawaii in non HWS mode is done through packet +* manager (PM), so we need to initialize PM for Hawaii. +*/ +if (dqm->dev->device_info->asic_family ==CHIP_HAWAII ) + ret =pm_init (&dqm->packets, dqm); + +return ret; }
Quoted 13 lines
Quoted 9 lines
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c static void uninitialize(struct device_queue_manager *dqm) · line 932
Quoted 9 lines
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c +3
-1static int stop_nocpsch (struct device_queue_manager *dqm) { -pm_uninit (&dqm->packets); +if (dqm->dev->device_info->asic_family ==CHIP_HAWAII ) +pm_uninit (&dqm->packets); +return 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
A message that is not in the archive (sent off-list or not yet received): 08aaa252-4aba-295f-f9d0-022635121efc-5C7GfCeVMHo@public.gmane.org
Okay, I will abandon it.
Yong
Quoted 9 lines · Felix
If you want to optimize driver init time, you should check what actually takes the most time. Randomly micro-optimizing things that may not even matter only increases complexity for no benefit.
Typically the things that make initialization slow are points where we synchronize with the GPU or random sleeps or delays to allow the hardware to complete something. A few lines of code that only run on the CPU will not make an appreciable difference.
Quoted 70 lines
Regards,
FelixQuoted 66 lines · Yong
I can fix that cosmetic line. I did not measure the difference, but driver initialization usually takes a longer time, that's why I am trying to reduce it. Also, it means one less thing to worry about during non HWS mode bringup, because we don't need to deal with HIQ any more. With that, what do you think now?
Regards,
Yong
Quoted 42 lines · Felix
Quoted 3 lines · Yong
The packet manager is only needed for HWS mode, as well as Hawaii in non HWS mode. So only initialize it under those scenarios. This is useful especially for emulation environment when things are slow.
I never thought of packet manager initialization as something expensive. Why does this matter? In emulation, the GPU is slow, but the CPU should be OK. Packet manager initialization doesn't do any waiting for the GPU, so I don't see how this would have any measurable impact.
Anyway, see one cosmetic comment inline.
Quoted 11 lines
Change-Id Iedfa07c94241e3252463e1e5ea537543c2ccef03Signed-off-by Yong Zhao <[email protected]>--- .../gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c +0
-0drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c static void uninitialize(struct device_queue_manager *dqm) · line 914
Quoted 4 lines
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c +1
-0@@ -911,13 +911,22 @@ static void uninitialize(struct device_queue_manager *dqm)static int start_nocpsch (struct device_queue_manager *dqm) { +int ret =0 ;checkpatch.pl would complain that there should be an empty line after variable declarations.
Quoted 11 lines
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c +7
-1init_interrupts (dqm); -return pm_init (&dqm->packets, dqm); +/* Cache flushing on Hawaii in non HWS mode is done through packet +* manager (PM), so we need to initialize PM for Hawaii. +*/ +if (dqm->dev->device_info->asic_family ==CHIP_HAWAII ) + ret =pm_init (&dqm->packets, dqm); + +return ret; }Quoted 9 lines
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c static void uninitialize(struct device_queue_manager *dqm) · line 932
Quoted 9 lines
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c +3
-1static int stop_nocpsch (struct device_queue_manager *dqm) { -pm_uninit (&dqm->packets); +if (dqm->dev->device_info->asic_family ==CHIP_HAWAII ) +pm_uninit (&dqm->packets); +return 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