All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu: fix kernel hang when starting VNC server
@ 2017-10-20  9:45 Xiangliang.Yu
       [not found] ` <1508492712-28961-1-git-send-email-Xiangliang.Yu-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Xiangliang.Yu @ 2017-10-20  9:45 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
  Cc: Xiangliang.Yu, Christian.Koenig-5C7GfCeVMHo

After starting VNC server or running CTS test, kernel will hang and
can see below call trace:

[961816] INFO: task khugepaged:42 blocked for more than 120 seconds.
[968581]       Tainted: G           OE   4.13.0 #1
[973495] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables
          this message.
[980962] khugepaged      D    0    42      2 0x00000000
[980967] Call Trace:
[980977]  __schedule+0x28d/0x890
[980982]  schedule+0x36/0x80
[980986]  rwsem_down_read_failed+0x139/0x1c0
[980991]  ? update_curr+0x100/0x1c0
[981004]  call_rwsem_down_read_failed+0x18/0x30
[981007]  down_read+0x20/0x40
[981012]  khugepaged_scan_mm_slot+0x78/0x1ac0
[981018]  ? __switch_to+0x23e/0x4a0
[981022]  ? finish_task_switch+0x79/0x240
[981026]  khugepaged+0x146/0x480
[981031]  ? remove_wait_queue+0x60/0x60
[981035]  kthread+0x109/0x140
[981037]  ? khugepaged_scan_mm_slot+0x1ac0/0x1ac0
[981039]  ? kthread_park+0x60/0x60
[981044]  ret_from_fork+0x25/0x30

After checking code and found 'commit b72cf4fca2bb7 ("drm/amdgpu: move
taking mmap_sem into get_user_pages v2")' forget to drop one of up_read
usage.

Signed-off-by: Xiangliang.Yu <Xiangliang.Yu@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
index fb72edc..08b37c2 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
@@ -323,7 +323,7 @@ int amdgpu_gem_userptr_ioctl(struct drm_device *dev, void *data,
 		r = amdgpu_ttm_tt_get_user_pages(bo->tbo.ttm,
 						 bo->tbo.ttm->pages);
 		if (r)
-			goto unlock_mmap_sem;
+			goto release_object;
 
 		r = amdgpu_bo_reserve(bo, true);
 		if (r)
@@ -348,9 +348,6 @@ int amdgpu_gem_userptr_ioctl(struct drm_device *dev, void *data,
 free_pages:
 	release_pages(bo->tbo.ttm->pages, bo->tbo.ttm->num_pages, false);
 
-unlock_mmap_sem:
-	up_read(&current->mm->mmap_sem);
-
 release_object:
 	drm_gem_object_put_unlocked(gobj);
 
-- 
2.7.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] drm/amdgpu: fix kernel hang when starting VNC server
       [not found] ` <1508492712-28961-1-git-send-email-Xiangliang.Yu-5C7GfCeVMHo@public.gmane.org>
@ 2017-10-20 11:01   ` Christian König
  0 siblings, 0 replies; 2+ messages in thread
From: Christian König @ 2017-10-20 11:01 UTC (permalink / raw)
  To: Xiangliang.Yu, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

Am 20.10.2017 um 11:45 schrieb Xiangliang.Yu:
> After starting VNC server or running CTS test, kernel will hang and
> can see below call trace:
>
> [961816] INFO: task khugepaged:42 blocked for more than 120 seconds.
> [968581]       Tainted: G           OE   4.13.0 #1
> [973495] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables
>            this message.
> [980962] khugepaged      D    0    42      2 0x00000000
> [980967] Call Trace:
> [980977]  __schedule+0x28d/0x890
> [980982]  schedule+0x36/0x80
> [980986]  rwsem_down_read_failed+0x139/0x1c0
> [980991]  ? update_curr+0x100/0x1c0
> [981004]  call_rwsem_down_read_failed+0x18/0x30
> [981007]  down_read+0x20/0x40
> [981012]  khugepaged_scan_mm_slot+0x78/0x1ac0
> [981018]  ? __switch_to+0x23e/0x4a0
> [981022]  ? finish_task_switch+0x79/0x240
> [981026]  khugepaged+0x146/0x480
> [981031]  ? remove_wait_queue+0x60/0x60
> [981035]  kthread+0x109/0x140
> [981037]  ? khugepaged_scan_mm_slot+0x1ac0/0x1ac0
> [981039]  ? kthread_park+0x60/0x60
> [981044]  ret_from_fork+0x25/0x30
>
> After checking code and found 'commit b72cf4fca2bb7 ("drm/amdgpu: move
> taking mmap_sem into get_user_pages v2")' forget to drop one of up_read
> usage.
>
> Signed-off-by: Xiangliang.Yu <Xiangliang.Yu@amd.com>

Reviewed-by: Christian König <christian.koenig@amd.com>

> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 5 +----
>   1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
> index fb72edc..08b37c2 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
> @@ -323,7 +323,7 @@ int amdgpu_gem_userptr_ioctl(struct drm_device *dev, void *data,
>   		r = amdgpu_ttm_tt_get_user_pages(bo->tbo.ttm,
>   						 bo->tbo.ttm->pages);
>   		if (r)
> -			goto unlock_mmap_sem;
> +			goto release_object;
>   
>   		r = amdgpu_bo_reserve(bo, true);
>   		if (r)
> @@ -348,9 +348,6 @@ int amdgpu_gem_userptr_ioctl(struct drm_device *dev, void *data,
>   free_pages:
>   	release_pages(bo->tbo.ttm->pages, bo->tbo.ttm->num_pages, false);
>   
> -unlock_mmap_sem:
> -	up_read(&current->mm->mmap_sem);
> -
>   release_object:
>   	drm_gem_object_put_unlocked(gobj);
>   


_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-10-20 11:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-20  9:45 [PATCH] drm/amdgpu: fix kernel hang when starting VNC server Xiangliang.Yu
     [not found] ` <1508492712-28961-1-git-send-email-Xiangliang.Yu-5C7GfCeVMHo@public.gmane.org>
2017-10-20 11:01   ` Christian König

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.