From nobody Wed Mar 12 20:09:54 2025 X-Original-To: x11@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ZChYt5ybZz5qQfG for ; Wed, 12 Mar 2025 20:09:54 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ZChYt4l6nz3g8R for ; Wed, 12 Mar 2025 20:09:54 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741810194; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hxSDIUSoKiM2DtyMaarCq76nIzJK4ay7G+VeNRt3lJU=; b=BpuD1EJhkXD4hBYbaZ2z8SK0Vec7rA2vlawbt6WH3DZBr5JolrPUCkvqRmYLyanYKXXUtJ HIRb9CS1cz8PT8m+WuWma8FacDuquWKFS2ypbrNjZlGcD+p+WtpoDd3Mcd/HljE2rN/TFZ 3XROCkxu/P7oil/gLH1k/6wcau8tiqS1t1oT0G6nkmNWtJkRVtK4lkjEalArB8Fo5Bn6Jj RH/gbPRs6JKpDUEU4DvMBV2MRTikZ4jvni/6ZGwgWPkuvgbh3K0vkFY33JYRnHNw9EnSXk epZuB3TNle/MC7epwxpx8dmicb4SEi10hIzWZhDo9rQzQqZpa+yNyZ30saMPYQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741810194; a=rsa-sha256; cv=none; b=uaOCo+O88rzx8CMyRV11gNb/52kW0awIucxGMIcIZjGoLBiq7v7F4nY9ekHKnN7p5CG9Oj 9JPbDP25qgI7oy0wASh9NTbYPaJRZbqj3gvOlkjaNjbc2v69D9SFoJ3lSNhNEKwh0MPXMK tLh1KfGueZnexRLFt0xyV/4FBzg2LIqPpBTRN4hI64gXmMTU5YeEGHk1O7KWC4Cag1ZY6b mAkVjUhnEGJ9WRfxs1IzqDe4Q4b8Bv7bflrSzthL+bXBMmDEk7g8fB3qtwAgzNQReZHxY5 NU+A5tB9dwfsoM/XU5FQmHEad1Pm2O6uI8QanQtwSTC2OVvCZQRqn3XsgQQdMw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741810194; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hxSDIUSoKiM2DtyMaarCq76nIzJK4ay7G+VeNRt3lJU=; b=L/SjVJRWjWmsMG+PXVuaehcVMXp1RObsr4ls7OuLzMEkKj9Iq9LmBERE6cJ+VYhPJHzzim bSJwI7sWzF/kJe4KjwPdMtwHOy3TkVC7u8gluIMrtyCiWcALQ73bpn2oDQE1a6NAal5upz ZKXaml/AORnAqniDSFnapR6ILgEKu7LHgobHk5uUuV6VqIvL9r58dFU2BegWn3bVmyVmrS llZAXg/l1uY1fv5W/wlLH/Edd9GblXGvp5pbLxP1JIgJsvDrt8kQpiC3BQ6O4LLs7JH245 yngBB7RDRY+IWQs51qg5KNOwUn9mYbek56UPP3AtSl90GSY6q60Y8Rir9lANFw== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ZChYt3pQjz9sP for ; Wed, 12 Mar 2025 20:09:54 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 52CK9rr5035867 for ; Wed, 12 Mar 2025 20:09:53 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 52CK9rj2035864 for x11@FreeBSD.org; Wed, 12 Mar 2025 20:09:53 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: x11@FreeBSD.org Subject: [Bug 277476] graphics/drm-515-kmod: amdgpu periodic hangs due to phys contig allocations Date: Wed, 12 Mar 2025 20:09:54 +0000 X-Bugzilla-Reason: CC AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Ports & Packages X-Bugzilla-Component: Individual Port(s) X-Bugzilla-Version: Latest X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: rozhuk.im@gmail.com X-Bugzilla-Status: In Progress X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: x11@FreeBSD.org X-Bugzilla-Flags: maintainer-feedback? X-Bugzilla-Changed-Fields: attachments.created Message-ID: In-Reply-To: References: Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: X11 List-Archive: https://lists.freebsd.org/archives/freebsd-x11 List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: freebsd-x11@freebsd.org Sender: owner-freebsd-x11@FreeBSD.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D277476 --- Comment #20 from Ivan Rozhuk --- Created attachment 258607 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D258607&action= =3Dedit dtrace profile Patch did not help, at least in case: xorg + amdgpu xdriver. This how it was landed on 14/stable: https://github.com/rozhuk-im/freebsd/commit/b739c10c50aa37e247dc95f7b93f6fe= 58d86016d I have attached dtrace profile output that captured while freezes happen. I do not see here vm_phys_alloc_contig() after ttm_pool_alloc(), probably -O2/-O3 opt level "optimize" out it. Here few new things that show increased latency on freezes: (I do not collect many freezes, in some tests only few freezes collected) kernel`lock_delay+0x12 amdgpu.ko`amdgpu_gem_fault+0x86 kernel`linux_cdev_pager_populate+0x128 kernel`vm_fault_allocate+0x185 kernel`vm_fault+0x39c kernel`vm_fault_trap+0x4c kernel`trap_pfault+0x20a kernel`trap+0x4a8 kernel`0xffffffff80a11ca8 20 dtrace -n 'fbt::amdgpu_gem_fault:entry{self->ts=3Dtimestamp}' -n 'fbt::amdgpu_gem_fault:return/self->ts/{this->delta=3Dtimestamp-self->ts; @=3Dquantize(this->delta);}' -n 'tick-1sec{printa(@)}' 0 66064 :tick-1sec=20 value ------------- Distribution ------------- count=20=20=20=20 512 | 0=20=20=20=20=20= =20=20=20 1024 | 1=20=20=20=20=20= =20=20=20 2048 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 1357=20=20=20=20= =20 4096 |@@@ 110=20=20=20=20= =20=20 8192 |@@@ 103=20=20=20=20= =20=20 16384 | 4=20=20=20=20=20= =20=20=20 32768 | 3=20=20=20=20=20= =20=20=20 65536 | 0=20=20=20=20=20= =20=20=20 131072 | 0=20=20=20=20=20= =20=20=20 262144 | 0=20=20=20=20=20= =20=20=20 524288 | 0=20=20=20=20=20= =20=20=20 1048576 | 0=20=20=20=20=20= =20=20=20 2097152 | 1=20=20=20=20=20= =20=20=20 4194304 | 3=20=20=20=20=20= =20=20=20 8388608 | 2=20=20=20=20=20= =20=20=20 16777216 | 0=20=20=20=20=20= =20=20=20 33554432 | 0=20=20=20=20=20= =20=20=20 67108864 | 0=20=20=20=20=20= =20=20=20 134217728 | 0=20=20=20=20=20= =20=20=20 268435456 | 1=20=20=20=20=20= =20=20=20 536870912 | 1=20=20=20=20=20= =20=20=20 1073741824 | 1=20=20=20=20=20= =20=20=20 2147483648 | 0=20=20=20=20=20= =20=20=20 kernel`lock_delay+0x14 kernel`malloc_large+0x2c kernel`lkpi_kmalloc_cb+0x44 kernel`lkpi_kmalloc+0x27 amdgpu.ko`dc_create_state+0x18 amdgpu.ko`amdgpu_dm_atomic_commit_tail+0xd4 drm.ko`commit_tail+0xa7 kernel`linux_work_fn+0xed kernel`taskqueue_run_locked+0x187 kernel`taskqueue_thread_loop+0xc2 kernel`fork_exit+0x86 kernel`0xffffffff80a12d0e 88 dtrace -n 'fbt::dc_create_state:entry{self->ts=3Dtimestamp}' -n 'fbt::dc_create_state:return/self->ts/{this->delta=3Dtimestamp-self->ts; @=3Dquantize(this->delta);}' -n 'tick-1sec{printa(@)}' 0 66064 :tick-1sec=20 value ------------- Distribution ------------- count=20=20=20=20 4096 | 0=20=20=20=20=20= =20=20=20 8192 | 2=20=20=20=20=20= =20=20=20 16384 |@@@@@@@@@@@@@@@@@@@@@ 1271=20=20=20=20= =20 32768 |@@@@@@@@@@@@@@@@@@ 1087=20=20=20=20= =20 65536 | 30=20=20=20=20= =20=20=20 131072 | 1=20=20=20=20=20= =20=20=20 262144 | 0=20=20=20=20=20= =20=20=20 524288 | 3=20=20=20=20=20= =20=20=20 1048576 | 4=20=20=20=20=20= =20=20=20 2097152 | 2=20=20=20=20=20= =20=20=20 4194304 | 0=20=20=20=20=20= =20=20=20 8388608 | 0=20=20=20=20=20= =20=20=20 16777216 | 0=20=20=20=20=20= =20=20=20 33554432 | 0=20=20=20=20=20= =20=20=20 67108864 | 0=20=20=20=20=20= =20=20=20 134217728 | 1=20=20=20=20=20= =20=20=20 268435456 | 1=20=20=20=20=20= =20=20=20 536870912 | 5=20=20=20=20=20= =20=20=20 1073741824 | 4=20=20=20=20=20= =20=20=20 2147483648 | 0=20=20=20=20=20= =20=20=20 kernel`lock_delay+0x14 kernel`free+0x9b amdgpu.ko`amdgpu_dm_atomic_commit_tail+0x2f9a drm.ko`commit_tail+0xa7 kernel`linux_work_fn+0xed kernel`taskqueue_run_locked+0x187 kernel`taskqueue_thread_loop+0xc2 kernel`fork_exit+0x86 kernel`0xffffffff809aaf6e 399 dtrace -n 'fbt::amdgpu_dm_atomic_commit_tail:entry{self->ts=3Dtimestamp}' -n 'fbt::amdgpu_dm_atomic_commit_tail:return/self->ts/{this->delta=3Dtimestamp= -self->ts; @=3Dquantize(this->delta);}' -n 'tick-1sec{printa(@)}' 0 66190 :tick-1sec=20 value ------------- Distribution ------------- count=20=20=20=20 16384 | 0=20=20=20=20=20= =20=20=20 32768 | 4=20=20=20=20=20= =20=20=20 65536 | 6=20=20=20=20=20= =20=20=20 131072 | 2=20=20=20=20=20= =20=20=20 262144 | 0=20=20=20=20=20= =20=20=20 524288 | 6=20=20=20=20=20= =20=20=20 1048576 | 15=20=20=20=20= =20=20=20 2097152 |@ 29=20=20=20=20= =20=20=20 4194304 |@@@ 106=20=20=20=20= =20=20 8388608 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 1323=20=20=20=20= =20 16777216 |@ 44=20=20=20=20= =20=20=20 33554432 | 1=20=20=20=20=20= =20=20=20 67108864 | 2=20=20=20=20=20= =20=20=20 134217728 | 4=20=20=20=20=20= =20=20=20 268435456 | 8=20=20=20=20=20= =20=20=20 536870912 | 5=20=20=20=20=20= =20=20=20 1073741824 | 5=20=20=20=20=20= =20=20=20 2147483648 | 0=20=20=20=20=20= =20=20=20 kernel`lock_delay+0x14 kernel`zone_import+0xf2 kernel`cache_alloc+0x309 kernel`cache_alloc_retry+0x2c kernel`malloc+0x48 ttm.ko`ttm_sg_tt_init+0x61 amdgpu.ko`amdgpu_ttm_tt_create+0x4a ttm.ko`ttm_tt_create+0x4e ttm.ko`ttm_bo_validate+0x60 ttm.ko`ttm_bo_init_reserved+0x194 amdgpu.ko`amdgpu_bo_create+0x295 amdgpu.ko`amdgpu_bo_create_user+0x21 amdgpu.ko`amdgpu_gem_userptr_ioctl+0x82 drm.ko`drm_ioctl_kernel+0xbc drm.ko`drm_ioctl+0x25e kernel`linux_file_ioctl+0x30f kernel`kern_ioctl+0x1b0 kernel`sys_ioctl+0x117 kernel`amd64_syscall+0xeb kernel`0xffffffff809aa81b 46 dtrace -n 'fbt::amdgpu_ttm_tt_create:entry{self->ts=3Dtimestamp}' -n 'fbt::amdgpu_ttm_tt_create:return/self->ts/{this->delta=3Dtimestamp-self->t= s; @=3Dquantize(this->delta);}' -n 'tick-1sec{printa(@)}' 0 66190 :tick-1sec=20 value ------------- Distribution ------------- count=20=20=20=20 128 | 0=20=20=20=20=20= =20=20=20 256 | 4=20=20=20=20=20= =20=20=20 512 |@@@@@@@@@@ 5764=20=20=20=20= =20 1024 |@@@@@@@@@@@@ 6635=20=20=20=20= =20 2048 |@@@@@@@@@ 5087=20=20=20=20= =20 4096 |@@@@@@@@ 4334=20=20=20=20= =20 8192 |@@ 875=20=20=20=20= =20=20 16384 | 72=20=20=20=20= =20=20=20 32768 | 9=20=20=20=20=20= =20=20=20 65536 | 3=20=20=20=20=20= =20=20=20 131072 | 0=20=20=20=20=20= =20=20=20 (this looks ok) dtrace -n 'fbt::amdgpu_bo_create:entry{self->ts=3Dtimestamp}' -n 'fbt::amdgpu_bo_create:return/self->ts/{this->delta=3Dtimestamp-self->ts; @=3Dquantize(this->delta);}' -n 'tick-1sec{printa(@)}' 0 66190 :tick-1sec=20 value ------------- Distribution ------------- count=20=20=20=20 256 | 0=20=20=20=20=20= =20=20=20 512 | 2=20=20=20=20=20= =20=20=20 1024 |@@@@@@ 2303=20=20=20=20= =20 2048 |@@@@@@@@@@ 4190=20=20=20=20= =20 4096 |@@@@@@@@@@@@ 4800=20=20=20=20= =20 8192 |@@@@@@@@@@ 4002=20=20=20=20= =20 16384 |@@ 845=20=20=20=20= =20=20 32768 | 124=20=20=20=20= =20=20 65536 | 39=20=20=20=20= =20=20=20 131072 | 20=20=20=20=20= =20=20=20 262144 | 4=20=20=20=20=20= =20=20=20 524288 | 9=20=20=20=20=20= =20=20=20 1048576 | 2=20=20=20=20=20= =20=20=20 2097152 | 3=20=20=20=20=20= =20=20=20 4194304 | 8=20=20=20=20=20= =20=20=20 8388608 | 5=20=20=20=20=20= =20=20=20 16777216 | 0=20=20=20=20=20= =20=20=20 33554432 | 1=20=20=20=20=20= =20=20=20 67108864 | 2=20=20=20=20=20= =20=20=20 134217728 | 1=20=20=20=20=20= =20=20=20 268435456 | 0=20=20=20=20=20= =20=20=20 536870912 | 2=20=20=20=20=20= =20=20=20 1073741824 | 0=20=20=20=20=20= =20=20=20 2147483648 | 1=20=20=20=20=20= =20=20=20 4294967296 | 0=20=20=20=20=20= =20=20=20 dtrace -n 'fbt::add_hole:entry{self->ts=3Dtimestamp}' -n 'fbt::add_hole:return/self->ts/{this->delta=3Dtimestamp-self->ts; @=3Dquantize(this->delta);}' -n 'tick-1sec{printa(@)}' 0 66190 :tick-1sec=20 value ------------- Distribution ------------- count=20=20=20=20 128 | 0=20=20=20=20=20= =20=20=20 256 |@@@@@@@@@@@@ 5762=20=20=20=20= =20 512 |@@@@@@@@@@@@@ 6548=20=20=20=20= =20 1024 |@@@@@@@ 3287=20=20=20=20= =20 2048 |@@@@@ 2648=20=20=20=20= =20 4096 |@@@ 1508=20=20=20=20= =20 8192 | 105=20=20=20=20= =20=20 16384 | 11=20=20=20=20= =20=20=20 32768 | 4=20=20=20=20=20= =20=20=20 65536 | 1=20=20=20=20=20= =20=20=20 131072 | 0=20=20=20=20=20= =20=20=20 (this looks ok) dtrace -n 'fbt::ttm_pool_alloc:entry{self->ts=3Dtimestamp}' -n 'fbt::ttm_pool_alloc:return/self->ts/{this->delta=3Dtimestamp-self->ts; @=3Dquantize(this->delta);}' -n 'tick-1sec{printa(@)}' 0 66190 :tick-1sec=20 value ------------- Distribution ------------- count=20=20=20=20 128 | 0=20=20=20=20=20= =20=20=20 256 |@@ 29=20=20=20=20= =20=20=20 512 |@@@@@@@@ 96=20=20=20=20= =20=20=20 1024 |@@@@@@ 81=20=20=20=20= =20=20=20 2048 |@@@@@ 67=20=20=20=20= =20=20=20 4096 |@@@@@@@@ 106=20=20=20=20= =20=20 8192 |@@@ 33=20=20=20=20= =20=20=20 16384 | 5=20=20=20=20=20= =20=20=20 32768 | 1=20=20=20=20=20= =20=20=20 65536 |@ 17=20=20=20=20= =20=20=20 131072 |@ 12=20=20=20=20= =20=20=20 262144 | 3=20=20=20=20=20= =20=20=20 524288 | 6=20=20=20=20=20= =20=20=20 1048576 |@ 10=20=20=20=20= =20=20=20 2097152 |@ 13=20=20=20=20= =20=20=20 4194304 | 2=20=20=20=20=20= =20=20=20 8388608 | 2=20=20=20=20=20= =20=20=20 16777216 | 3=20=20=20=20=20= =20=20=20 33554432 | 5=20=20=20=20=20= =20=20=20 67108864 | 3=20=20=20=20=20= =20=20=20 134217728 | 4=20=20=20=20=20= =20=20=20 268435456 |@ 7=20=20=20=20=20= =20=20=20 536870912 | 5=20=20=20=20=20= =20=20=20 1073741824 | 1=20=20=20=20=20= =20=20=20 2147483648 | 1=20=20=20=20=20= =20=20=20 4294967296 | 0=20=20=20=20=20= =20=20=20 If some one have ideas - I can play more with dtrace and test other patches/settings. --=20 You are receiving this mail because: You are on the CC list for the bug. You are the assignee for the bug.=