drm/amdkfd: simplify svm_range_unmap_from_gpus()
Subsystems (3)
PATCH 1/1 drm/amdkfd: simplify svm_range_unmap_from_gpus()
The function calls bitmap_or() followed by for_each_set_bit(). Switch it to the dedicated for_each_or_bit() and drop the temporary bitmap.
Signed-off-by Yury Norov <[email protected]>
--- drivers/gpu/drm/amd/amdkfd/kfd_svm.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/gpu/drm/amd/amdkfd/kfd_svm.c +1 -4
@@ -1344,7 +1344,6 @@ static int svm_range_unmap_from_gpus(struct svm_range *prange, unsigned long start, unsigned long last, uint32_t trigger) { -DECLARE_BITMAP (bitmap, MAX_GPU_INSTANCE); struct kfd_process_device *pdd;struct dma_fence *fence =NULL ;struct kfd_process *p;
@@ -1362,11 +1361,9 @@ svm_range_unmap_from_gpus(struct svm_range *prange, unsigned long start, prange->mapped_to_gpu = false; } -bitmap_or (bitmap, prange->bitmap_access, prange->bitmap_aip, -MAX_GPU_INSTANCE ); p = container_of(prange->svms, struct kfd_process, svms); -for_each_set_bit (gpuidx, bitmap,MAX_GPU_INSTANCE ) { +for_each_or_bit (gpuidx, prange->bitmap_access, prange->bitmap_aip,MAX_GPU_INSTANCE ) {pr_debug ("unmap from gpu idx 0x%x\n" , gpuidx); pdd =kfd_process_device_from_gpuidx (p, gpuidx);if (!pdd) {
Signature · 1 line
2.43.0
Quoted 5 lines · Yury Norov
The function calls
bitmap_or()followed byfor_each_set_bit(). Switch it to the dedicatedfor_each_or_bit()and drop the temporary bitmap.Signed-off-by Yury Norov <[email protected]>
The patch is
Reviewed-by Felix Kuehling <[email protected]>
I'm applying it to amd-staging-drm-next.
Thanks,
Felix
Quoted 29 lines
--- drivers/gpu/drm/amd/amdkfd/kfd_svm.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)drivers/gpu/drm/amd/amdkfd/kfd_svm.c +1
-4@@ -1344,7 +1344,6 @@ static int svm_range_unmap_from_gpus(struct svm_range *prange, unsigned long start, unsigned long last, uint32_t trigger) { -DECLARE_BITMAP (bitmap, MAX_GPU_INSTANCE); struct kfd_process_device *pdd;struct dma_fence *fence =NULL ;struct kfd_process *p;@@ -1362,11 +1361,9 @@ svm_range_unmap_from_gpus(struct svm_range *prange, unsigned long start, prange->mapped_to_gpu = false; } -bitmap_or (bitmap, prange->bitmap_access, prange->bitmap_aip, -MAX_GPU_INSTANCE ); p = container_of(prange->svms, struct kfd_process, svms); -for_each_set_bit (gpuidx, bitmap,MAX_GPU_INSTANCE ) { +for_each_or_bit (gpuidx, prange->bitmap_access, prange->bitmap_aip,MAX_GPU_INSTANCE ) {pr_debug ("unmap from gpu idx 0x%x\n" , gpuidx); pdd =kfd_process_device_from_gpuidx (p, gpuidx);if (!pdd) {