Issue #3136 has been updated by ftigeot.
Category set to Kernel
The "lwe" state is caused by the wait_event_xxx() Linux macro family.
One of the places where its usage differs significantly with Linux is in
drm_read()
This function should probably be synchronized with Linux.
Bug #3136: Xorg freezes on radeon: Xorg and kernel (ttm swap) in "lwe"
http://bugs.dragonflybsd.org/issues/3136#change-13446
* Author: peeter
* Status: New
* Priority: Normal
* Assignee:
* Category: Kernel
* Target version:
I've updated the CPU on my desktop from Ryzen 2400G to Ryzen 2600 (gfx card
remains Radeon R7 360). Updated master too to the latest and am getting freezes
which seem to be related to radeonkms. Xorg freezes but I can still ssh to the
machine which runs fine. Tried to find the locked threads. Not sure I succeeded
but here's what I found: an Xorg thread and kernel's (ttm swap) are in wchan
"lwe", both at radeon_fence_wait_seq_timeout().
Here's kgdb output:
* thread 1871: kernel (ttm swap)
---
(kgdb) thread 1871
[Switching to thread 1871 (kernel ttm swap)]
#0 0x80638569 in lwkt_switch () at /usr/src/sys/kern/lwkt_thread.c:810
810 lwkt_switch_return(td->td_switch(ntd));
(kgdb) back
#0 0x80638569 in lwkt_switch () at /usr/src/sys/kern/lwkt_thread.c:810
#1 0x80642788 in tsleep (ident=0xf80ac8417800, flags=1024,
wmesg=, timo=2147483647)
at /usr/src/sys/kern/kern_synch.c:716
#2 0x80642e2c in lksleep (ident=ident@entry=0xf80ac8417800,
lock=lock@entry=0xf80ac8417800,
flags=flags@entry=0, wmesg=wmesg@entry=0x830fb7ba "lwe",
timo=timo@entry=2147483647)
at /usr/src/sys/kern/kern_synch.c:827
#3 0x8301ee85 in radeon_fence_wait_seq_timeout
(rdev=0xf80ac8416400,
target_seq=target_seq@entry=0xf80ac846b8b0, intr=,
timeout=2147483647)
at /usr/src/sys/dev/drm/radeon/radeon_fence.c:400
#4 0x8301efcd in radeon_fence_wait (fence=,
intr=)
at /usr/src/sys/dev/drm/radeon/radeon_fence.c:443
#5 0x83e0e463 in ttm_bo_cleanup_refs_and_unlock
(bo=bo@entry=0xf80ae6264718,
interruptible=interruptible@entry=false,
no_wait_gpu=no_wait_gpu@entry=false)
at /usr/src/sys/dev/drm/drm/../ttm/ttm_bo.c:656
#6 0x83e0fc00 in ttm_bo_swapout (shrink=0xf8068f00bf28) at
/usr/src/sys/dev/drm/drm/../ttm/ttm_bo.c:1886
#7 0x83e10883 in ttm_shrink (glob=0xf80ac51b9208, from_wq=true,
extra=0)
at /usr/src/sys/dev/drm/drm/../ttm/ttm_memory.c:174
#8 0x80660639 in taskqueue_run (queue=0xf8068f469660, lock_held=1)
at /usr/src/sys/kern/subr_taskqueue.c:338
#9 0x806607cd in taskqueue_thread_loop (arg=) at
/usr/src/sys/kern/subr_taskqueue.c:498
#10 0x80635550 in ?? () at /usr/src/sys/kern/lwkt_thread.c:1748
#11 0x in ?? ()
---
* 445 Xorg pid 741/1
---
(kgdb) thread 445
[Switching to thread 445 (pid 741/1, Xorg)]
#0 0x80638569 in lwkt_switch () at /usr/src/sys/kern/lwkt_thread.c:810
810 lwkt_switch_return(td->td_switch(ntd));
(kgdb) back
#0 0x80638569 in lwkt_switch () at /usr/src/sys/kern/lwkt_thread.c:810
#1 0x806423cd in tsleep (ident=0xf80ac8417800, flags=1024,
wmesg=, timo=2147483647)
at /usr/src/sys/kern/kern_synch.c:703
#2 0x80642e2c in lksleep (ident=ident@entry=0xf80ac8417800,
lock=lock@entry=0xf80ac8417800,
flags=flags@entry=0, wmesg=wmesg@entry=0x830fb7ba "lwe",
timo=timo@entry=2147483647)
at /usr/src/sys/kern/kern_synch.c:827
#3 0x8301ee85 in radeon_fence_wait_seq_timeout
(rdev=0xf80ac8416400,
target_seq=target_seq@entry=0xf80acfa1f118, intr=,
timeout=2147483647)
at /usr/src/sys/dev/drm/radeon/radeon_fence.c:400
#4 0x8301efcd in radeon_fence_wait (fence=,
intr=)
at /usr/src/sys/dev/drm/radeon/radeon_fence.c:443
#5 0x83e0e463 in ttm_bo_cleanup_refs_and_unlock
(bo=bo@entry=0xf80ae6264718,
interruptible=interruptible@entry=false,
no_wait_gpu=no_wait_gpu@entry=false)
at /usr/src/sys/dev/drm/drm/../ttm/ttm_bo.c:656
#6 0x83e0fc00 in ttm_bo_swapout (shrink=0xf8068f00bf28) at
/usr/src/sys/dev/drm/drm/../ttm/ttm_bo.c:1886
#7 0x83e10883 in ttm_shrink (glob=glob@entry=0xf80ac51b9208,
from_wq=from_wq@entry=false,
extra=extra@entry=5136) at /usr/src/sys/dev/drm/drm/../ttm/ttm_memory.c:174
#8 0x83e10f3c in ttm_mem_global_alloc_zone (interruptible=false,
no_wait=, memory=4096,
single_zone=0x0, glob=0xf80ac51b9208) at
/usr/src/sys/dev/drm/drm/../ttm/ttm_memory.c:416
#9 ttm_mem_global_alloc_page (glob=glob@entry=0xf80ac51b9208,
vm_page=, no_wait=no_wait@entry=false,
interruptible=interruptible@entry=false) at
/usr/src/sys/dev/drm/drm/../ttm/ttm_memory.c:449
#10 0x83e11f52 in ttm_pool_populate (ttm=ttm@entry=0xf806894a7f18)
at