From mboxrd@z Thu Jan 1 00:00:00 1970 From: bugzilla-daemon@freedesktop.org Subject: [Bug 100712] ring 0 stalled after bytes_moved_threshold reached - Cap Verde - HD 7770 Date: Tue, 18 Apr 2017 15:14:55 +0000 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1238147873==" Return-path: Received: from culpepper.freedesktop.org (culpepper.freedesktop.org [131.252.210.165]) by gabe.freedesktop.org (Postfix) with ESMTP id 27EE26E1BD for ; Tue, 18 Apr 2017 15:14:55 +0000 (UTC) List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org --===============1238147873== Content-Type: multipart/alternative; boundary="14925284950.8e7ed20.10290"; charset="UTF-8" --14925284950.8e7ed20.10290 Date: Tue, 18 Apr 2017 15:14:55 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://bugs.freedesktop.org/ Auto-Submitted: auto-generated https://bugs.freedesktop.org/show_bug.cgi?id=3D100712 Bug ID: 100712 Summary: ring 0 stalled after bytes_moved_threshold reached - Cap Verde - HD 7770 Product: DRI Version: DRI git Hardware: Other OS: All Status: NEW Severity: normal Priority: medium Component: DRM/Radeon Assignee: dri-devel@lists.freedesktop.org Reporter: julien.isorce@gmail.com Kernel 4.9 from https://cgit.freedesktop.org/~agd5f/linux/log/?h=3Damd-staging-4.9 and late= st mesa. (same result with drm-next-4.12 branch) Same result with kernel 4.8 and mesa 12.0.6. In kernel radeon_object.c::radeon_bo_list_validate, once "bytes_moved > bytes_moved_threshold" is reached (this is the case for 850 bo in the same list_for_each_entry loop), I can see that radeon_ib_schedule emits a fence = that it takes more than the radeon.lockup_timeout to be signaled. In radeon_fence_activity, I checked that the "last_emitted" is the seq numb= er for this last emited fence. And last_seq is equal to last_emitted-1. Then the next call to ttm_wait_bo blocks (15 * HZ > radeon.lockup_timeout) until gpu lockup which leads to a gpu reset. Also it seems the fence is signaled by swapper after more than 10 seconds b= ut it is too late. I requires to reduce the "15" param above to 4 to see that. Is it normal that radeon_bo_list_validate still tries to move the bo if bytes_moved_threshold is reached ? Indeed ttm_bo_validate is always called = (it blits from vram to vram). Is it also normal that ttm_bo_validate is called with evict flag as true on= ce bytes_moved_threshold is reached ? --=20 You are receiving this mail because: You are the assignee for the bug.= --14925284950.8e7ed20.10290 Date: Tue, 18 Apr 2017 15:14:55 +0000 MIME-Version: 1.0 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://bugs.freedesktop.org/ Auto-Submitted: auto-generated
Bug ID 100712
Summary ring 0 stalled after bytes_moved_threshold reached - Cap Verd= e - HD 7770
Product DRI
Version DRI git
Hardware Other
OS All
Status NEW
Severity normal
Priority medium
Component DRM/Radeon
Assignee dri-devel@lists.freedesktop.org
Reporter julien.isorce@gmail.com

Kernel 4.9 from
https://cgit.freedesktop.org/~agd5f/linux/log/?h=3Damd-staging-4.9 =
and latest
mesa. (same result with drm-next-4.12 branch)
Same result with kernel 4.8 and mesa 12.0.6.

In kernel radeon_object.c::radeon_bo_list_validate, once "bytes_moved =
>
bytes_moved_threshold" is reached (this is the case for 850 bo in the =
same
list_for_each_entry loop), I can see that radeon_ib_schedule emits a fence =
that
it takes more than the radeon.lockup_timeout to be signaled.

In radeon_fence_activity, I checked that the "last_emitted" is th=
e seq number
for this last emited fence. And last_seq is equal to last_emitted-1.

Then the next call to ttm_wait_bo blocks (15 * HZ > radeon.lockup_timeou=
t)
until gpu lockup which leads to a gpu reset.

Also it seems the fence is signaled by swapper after more than 10 seconds b=
ut
it is too late. I requires to reduce the "15" param above to 4 to=
 see that.

Is it normal that radeon_bo_list_validate still tries to move the bo if
bytes_moved_threshold is reached ? Indeed ttm_bo_validate is always called =
(it
blits from vram to vram).
Is it also normal that ttm_bo_validate is called with evict flag as true on=
ce
bytes_moved_threshold is reached ?


You are receiving this mail because:
  • You are the assignee for the bug.
= --14925284950.8e7ed20.10290-- --===============1238147873== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZHJpLWRldmVs IG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vZHJpLWRldmVsCg== --===============1238147873==-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: bugzilla-daemon@freedesktop.org Subject: [Bug 100712] ring 0 stalled after bytes_moved_threshold reached - Cap Verde - HD 7770 Date: Tue, 18 Apr 2017 15:15:23 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1965487881==" Return-path: Received: from culpepper.freedesktop.org (culpepper.freedesktop.org [131.252.210.165]) by gabe.freedesktop.org (Postfix) with ESMTP id 8AC9D6E1AB for ; Tue, 18 Apr 2017 15:15:23 +0000 (UTC) In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org --===============1965487881== Content-Type: multipart/alternative; boundary="14925285230.FfB73.10516"; charset="UTF-8" --14925285230.FfB73.10516 Date: Tue, 18 Apr 2017 15:15:23 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://bugs.freedesktop.org/ Auto-Submitted: auto-generated https://bugs.freedesktop.org/show_bug.cgi?id=3D100712 --- Comment #1 from Julien Isorce --- Created attachment 130902 --> https://bugs.freedesktop.org/attachment.cgi?id=3D130902&action=3Dedit dmesg_HD7770_kernel_amd-staging-4.9_ring_stalled --=20 You are receiving this mail because: You are the assignee for the bug.= --14925285230.FfB73.10516 Date: Tue, 18 Apr 2017 15:15:23 +0000 MIME-Version: 1.0 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://bugs.freedesktop.org/ Auto-Submitted: auto-generated

Commen= t # 1 on bug 10071= 2 from Julien Isorce
Created attachment 130902 [de=
tails]
dmesg_HD7770_kernel_amd-staging-4.9_ring_stalled


You are receiving this mail because:
  • You are the assignee for the bug.
= --14925285230.FfB73.10516-- --===============1965487881== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZHJpLWRldmVs IG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vZHJpLWRldmVsCg== --===============1965487881==-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: bugzilla-daemon@freedesktop.org Subject: [Bug 100712] ring 0 stalled after bytes_moved_threshold reached - Cap Verde - HD 7770 Date: Tue, 18 Apr 2017 15:15:39 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2100422061==" Return-path: Received: from culpepper.freedesktop.org (culpepper.freedesktop.org [131.252.210.165]) by gabe.freedesktop.org (Postfix) with ESMTP id DC3AB6E1AB for ; Tue, 18 Apr 2017 15:15:39 +0000 (UTC) In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org --===============2100422061== Content-Type: multipart/alternative; boundary="14925285390.d791.10298"; charset="UTF-8" --14925285390.d791.10298 Date: Tue, 18 Apr 2017 15:15:39 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://bugs.freedesktop.org/ Auto-Submitted: auto-generated https://bugs.freedesktop.org/show_bug.cgi?id=3D100712 --- Comment #2 from Julien Isorce --- Created attachment 130903 --> https://bugs.freedesktop.org/attachment.cgi?id=3D130903&action=3Dedit dmesg_HD7770_kernel_amd-staging-4.9_ring_stalled --=20 You are receiving this mail because: You are the assignee for the bug.= --14925285390.d791.10298 Date: Tue, 18 Apr 2017 15:15:39 +0000 MIME-Version: 1.0 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://bugs.freedesktop.org/ Auto-Submitted: auto-generated

Commen= t # 2 on bug 10071= 2 from Julien Isorce
Created attachment 130903 [de=
tails]
dmesg_HD7770_kernel_amd-staging-4.9_ring_stalled


You are receiving this mail because:
  • You are the assignee for the bug.
= --14925285390.d791.10298-- --===============2100422061== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZHJpLWRldmVs IG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vZHJpLWRldmVsCg== --===============2100422061==-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: bugzilla-daemon@freedesktop.org Subject: [Bug 100712] ring 0 stalled after bytes_moved_threshold reached - Cap Verde - HD 7770 Date: Tue, 18 Apr 2017 15:16:45 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0521661951==" Return-path: Received: from culpepper.freedesktop.org (culpepper.freedesktop.org [IPv6:2610:10:20:722:a800:ff:fe98:4b55]) by gabe.freedesktop.org (Postfix) with ESMTP id E1E5289D7F for ; Tue, 18 Apr 2017 15:16:44 +0000 (UTC) In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org --===============0521661951== Content-Type: multipart/alternative; boundary="14925286040.66EA.10516"; charset="UTF-8" --14925286040.66EA.10516 Date: Tue, 18 Apr 2017 15:16:44 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://bugs.freedesktop.org/ Auto-Submitted: auto-generated https://bugs.freedesktop.org/show_bug.cgi?id=3D100712 Julien Isorce changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #130903|0 |1 is obsolete| | --- Comment #3 from Julien Isorce --- Created attachment 130904 --> https://bugs.freedesktop.org/attachment.cgi?id=3D130904&action=3Dedit ddebug_dumps_HD7770_kernel_amd-staging-4.9_ring_stalled --=20 You are receiving this mail because: You are the assignee for the bug.= --14925286040.66EA.10516 Date: Tue, 18 Apr 2017 15:16:44 +0000 MIME-Version: 1.0 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://bugs.freedesktop.org/ Auto-Submitted: auto-generated Julien Isorce changed bug 10071= 2
What Removed Added
Attachment #130903 is obsolete   1

Commen= t # 3 on bug 10071= 2 from Julien Isorce
Created attachment 130904 [details]
ddebug_dumps_HD7770_kernel_amd-staging-4.9_ring_stalled


You are receiving this mail because:
  • You are the assignee for the bug.
= --14925286040.66EA.10516-- --===============0521661951== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZHJpLWRldmVs IG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vZHJpLWRldmVsCg== --===============0521661951==-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: bugzilla-daemon@freedesktop.org Subject: [Bug 100712] ring 0 stalled after bytes_moved_threshold reached - Cap Verde - HD 7770 Date: Wed, 19 Apr 2017 03:48:45 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0368290589==" Return-path: Received: from culpepper.freedesktop.org (culpepper.freedesktop.org [131.252.210.165]) by gabe.freedesktop.org (Postfix) with ESMTP id 084376E26E for ; Wed, 19 Apr 2017 03:48:45 +0000 (UTC) In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org --===============0368290589== Content-Type: multipart/alternative; boundary="14925737240.6dcf7.10414"; charset="UTF-8" --14925737240.6dcf7.10414 Date: Wed, 19 Apr 2017 03:48:44 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://bugs.freedesktop.org/ Auto-Submitted: auto-generated https://bugs.freedesktop.org/show_bug.cgi?id=3D100712 --- Comment #4 from Michel D=C3=A4nzer --- (In reply to Julien Isorce from comment #0) > In kernel radeon_object.c::radeon_bo_list_validate, once "bytes_moved > > bytes_moved_threshold" is reached (this is the case for 850 bo in the same > list_for_each_entry loop), I can see that radeon_ib_schedule emits a fence > that it takes more than the radeon.lockup_timeout to be signaled. radeon_ib_schedule is called for submitting the command stream from userspa= ce, not for any BO moves directly, right? How did you determine that this hang is directly related to bytes_moved / bytes_moved_threshold? Maybe it's only indirectly related, e.g. due to the threshold preventing a BO from being moved to VRAM despite userspace's preference. > Also it seems the fence is signaled by swapper after more than 10 seconds > but it is too late. I requires to reduce the "15" param above to 4 to see > that. How does "swapper" (what is that exactly?) signal the fence? > Is it normal that radeon_bo_list_validate still tries to move the bo if > bytes_moved_threshold is reached ? There are circumstances where a BO has to be moved even though the threshol= d is reached. > Indeed ttm_bo_validate is always called ttm_bo_validate must be called for every BO referenced by the command stream from userspace for correct lifetime management of its memory. > (it blits from vram to vram). It might be worth looking into why this happens, though. If domain =3D=3D current_domain =3D=3D RADEON_GEM_DOMAIN_VRAM, I wouldn't expect ttm_bo_vali= date to trigger a blit. --=20 You are receiving this mail because: You are the assignee for the bug.= --14925737240.6dcf7.10414 Date: Wed, 19 Apr 2017 03:48:44 +0000 MIME-Version: 1.0 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://bugs.freedesktop.org/ Auto-Submitted: auto-generated

Commen= t # 4 on bug 10071= 2 from Michel D=C3=A4nzer
(In reply to Julien Isorce from comment #0)
> In kernel radeon_object.c::radeon_bo_list_valida=
te, once "bytes_moved >
> bytes_moved_threshold" is reached (this is the case for 850 bo in=
 the same
> list_for_each_entry loop), I can see that radeon_ib_schedule emits a f=
ence
> that it takes more than the radeon.lockup_timeout to be signaled.

radeon_ib_schedule is called for submitting the command stream from userspa=
ce,
not for any BO moves directly, right?

How did you determine that this hang is directly related to bytes_moved /
bytes_moved_threshold? Maybe it's only indirectly related, e.g. due to the
threshold preventing a BO from being moved to VRAM despite userspace's
preference.


> Also it seems the fence is signaled by swapper a=
fter more than 10 seconds
> but it is too late. I requires to reduce the "15" param abov=
e to 4 to see
> that.

How does "swapper" (what is that exactly?) signal the fence?


> Is it normal that radeon_bo_list_validate still =
tries to move the bo if
> bytes_moved_threshold is reached ?

There are circumstances where a BO has to be moved even though the threshol=
d is
reached.


> Indeed ttm_bo_validate is always called

ttm_bo_validate must be called for every BO referenced by the command stream
from userspace for correct lifetime management of its memory.


> (it blits from vram to vram).

It might be worth looking into why this happens, though. If domain =3D=3D
current_domain =3D=3D RADEON_GEM_DOMAIN_VRAM, I wouldn't expect ttm_bo_vali=
date to
trigger a blit.


You are receiving this mail because:
  • You are the assignee for the bug.
= --14925737240.6dcf7.10414-- --===============0368290589== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZHJpLWRldmVs IG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vZHJpLWRldmVsCg== --===============0368290589==-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: bugzilla-daemon@freedesktop.org Subject: [Bug 100712] ring 0 stalled after bytes_moved_threshold reached - Cap Verde - HD 7770 Date: Wed, 19 Apr 2017 12:03:32 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1801126957==" Return-path: Received: from culpepper.freedesktop.org (culpepper.freedesktop.org [IPv6:2610:10:20:722:a800:ff:fe98:4b55]) by gabe.freedesktop.org (Postfix) with ESMTP id 9458D6E079 for ; Wed, 19 Apr 2017 12:03:32 +0000 (UTC) In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org --===============1801126957== Content-Type: multipart/alternative; boundary="14926034120.9cCB.9771"; charset="UTF-8" --14926034120.9cCB.9771 Date: Wed, 19 Apr 2017 12:03:32 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://bugs.freedesktop.org/ Auto-Submitted: auto-generated https://bugs.freedesktop.org/show_bug.cgi?id=3D100712 --- Comment #5 from Julien Isorce --- (In reply to Michel D=C3=A4nzer from comment #4) > (In reply to Julien Isorce from comment #0) > > In kernel radeon_object.c::radeon_bo_list_validate, once "bytes_moved > > > bytes_moved_threshold" is reached (this is the case for 850 bo in the s= ame > > list_for_each_entry loop), I can see that radeon_ib_schedule emits a fe= nce > > that it takes more than the radeon.lockup_timeout to be signaled. >=20 > radeon_ib_schedule is called for submitting the command stream from > userspace, not for any BO moves directly, right? >=20 > How did you determine that this hang is directly related to bytes_moved / > bytes_moved_threshold? Maybe it's only indirectly related, e.g. due to the > threshold preventing a BO from being moved to VRAM despite userspace's > preference. >=20 I added a trace and the fence that is not signaled on time is always the one emited by radeon_ib_schedule after that the bytes_moved_threshold is reache= d. But you are right it could be only indirectly related. Here is the sequence I have: ioctl_radeon_cs radeon_bo_list_validate bytes_moved > bytes_moved_threshold(=3D1024*1024ull) 800 bo are not moved from gtt to vram because of that. radeon_cs_ib_vm_chunk radeon_ib_schedule(rdev, &parser->ib, NULL, true); radeon_fence_emit on ring 0 r600_mmio_hdp_flush /ioctl_radeon_cs Then anything calling ttm_bo_wait will block more than the radeon.lockup_timeout because the above fence is not signaled on time. Could it be that something is not flushed properly ? (ref: https://patchwork.kernel.org/patch/5807141/ ? tlb_flush ?)=20 Are you saying that some bos are required to be moved from gtt to vram in o= rder for this fence to be signaled ? As you can see above it happens when vram_usage >=3D half_vram so radeon_bo_get_threshold_for_moves returns 1024*1024, which explains why onl= y 1 or 2 bos can be moved from gtt to vram in that case and why all others are forced to stay in gtt. In the same run of radeon_bo_list_validate there are many calls to ttm_bo_validate with both domain and current_domain as VRAM, this is the ca= se for around 400 bo. Maybe this cause delay for this fence to be signaled, providing vram usage is high too. >=20 > > Also it seems the fence is signaled by swapper after more than 10 secon= ds > > but it is too late. I requires to reduce the "15" param above to 4 to s= ee > > that. >=20 > How does "swapper" (what is that exactly?) signal the fence? My wording was wrong sorry, I should have said "the first entity noticing t= hat the fence is signaled" by calling radeon_fence_activity. swapper is the name for process 0 (idle). I change drm logging to print process name and id: (current->comm, current->pid) >=20 > It might be worth looking into why this happens, though. If domain =3D=3D > current_domain =3D=3D RADEON_GEM_DOMAIN_VRAM, I wouldn't expect ttm_bo_va= lidate > to trigger a blit. I will check though I think I get just confused by a previous trace. --=20 You are receiving this mail because: You are the assignee for the bug.= --14926034120.9cCB.9771 Date: Wed, 19 Apr 2017 12:03:32 +0000 MIME-Version: 1.0 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://bugs.freedesktop.org/ Auto-Submitted: auto-generated

Commen= t # 5 on bug 10071= 2 from Julien Isorce
(In reply to Michel D=C3=A4nzer from comment #4)
> (In reply to Julien Isorce from comment #0)
> > In kernel radeon_object.c::radeon_bo_list_validate, once "by=
tes_moved >
> > bytes_moved_threshold" is reached (this is the case for 850 =
bo in the same
> > list_for_each_entry loop), I can see that radeon_ib_schedule emit=
s a fence
> > that it takes more than the radeon.lockup_timeout to be signaled.
>=20
> radeon_ib_schedule is called for submitting the command stream from
> userspace, not for any BO moves directly, right?
>=20
> How did you determine that this hang is directly related to bytes_move=
d /
> bytes_moved_threshold? Maybe it's only indirectly related, e.g. due to=
 the
> threshold preventing a BO from being moved to VRAM despite userspace's
> preference.
> 

I added a trace and the fence that is not signaled on time is always the one
emited by radeon_ib_schedule after that the bytes_moved_threshold is reache=
d.
But you are right it could be only indirectly related.

Here is the sequence I have:

ioctl_radeon_cs
  radeon_bo_list_validate
    bytes_moved > bytes_moved_threshold(=3D1024*1024ull)
    800 bo are not moved from gtt to vram because of that.
  radeon_cs_ib_vm_chunk
    radeon_ib_schedule(rdev, &parser->ib, NULL, true);
      radeon_fence_emit on ring 0
      r600_mmio_hdp_flush
/ioctl_radeon_cs

Then anything calling ttm_bo_wait will block more than the
radeon.lockup_timeout because the above fence is not signaled on time.
Could it be that something is not flushed properly ? (ref:
https://patchwork.k=
ernel.org/patch/5807141/ ? tlb_flush ?)=20

Are you saying that some bos are required to be moved from gtt to vram in o=
rder
for this fence to be signaled ?

As you can see above it happens when vram_usage >=3D half_vram so
radeon_bo_get_threshold_for_moves returns 1024*1024, which explains why onl=
y 1
or 2 bos can be moved from gtt to vram in that case and why all others are
forced to stay in gtt.

In the same run of radeon_bo_list_validate there are many calls to
ttm_bo_validate with both domain and current_domain as VRAM, this is the ca=
se
for around 400 bo. Maybe this cause delay for this fence to be signaled,
providing vram usage is high too.

>=20
> > Also it seems the fence is signaled by swapper after more than 10=
 seconds
> > but it is too late. I requires to reduce the "15" param=
 above to 4 to see
> > that.
>=20
> How does "swapper" (what is that exactly?) signal the fence?=


My wording was wrong sorry, I should have said "the first entity notic=
ing that
the fence is signaled" by calling radeon_fence_activity. swapper is th=
e name
for process 0 (idle). I change drm logging to print process name and id:
(current->comm, current->pid)

>=20
> It might be worth looking into why this happens, though. If domain =3D=
=3D
> current_domain =3D=3D RADEON_GEM_DOMAIN_VRAM, I wouldn't expect ttm_bo=
_validate
> to trigger a blit.

I will check though I think I get just confused by a previous trace.


You are receiving this mail because:
  • You are the assignee for the bug.
= --14926034120.9cCB.9771-- --===============1801126957== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZHJpLWRldmVs IG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vZHJpLWRldmVsCg== --===============1801126957==-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: bugzilla-daemon@freedesktop.org Subject: [Bug 100712] ring 0 stalled after bytes_moved_threshold reached - Cap Verde - HD 7770 Date: Thu, 20 Apr 2017 15:15:00 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1353582747==" Return-path: Received: from culpepper.freedesktop.org (culpepper.freedesktop.org [131.252.210.165]) by gabe.freedesktop.org (Postfix) with ESMTP id C27E86E5EB for ; Thu, 20 Apr 2017 15:15:00 +0000 (UTC) In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org --===============1353582747== Content-Type: multipart/alternative; boundary="14927013000.80755aDFc.28048"; charset="UTF-8" --14927013000.80755aDFc.28048 Date: Thu, 20 Apr 2017 15:15:00 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://bugs.freedesktop.org/ Auto-Submitted: auto-generated https://bugs.freedesktop.org/show_bug.cgi?id=3D100712 --- Comment #6 from Julien Isorce --- Created attachment 130947 --> https://bugs.freedesktop.org/attachment.cgi?id=3D130947&action=3Dedit dmesg_W9000_with_custom_fence_debug.log --=20 You are receiving this mail because: You are the assignee for the bug.= --14927013000.80755aDFc.28048 Date: Thu, 20 Apr 2017 15:15:00 +0000 MIME-Version: 1.0 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://bugs.freedesktop.org/ Auto-Submitted: auto-generated

Commen= t # 6 on bug 10071= 2 from Julien Isorce
Created =
attachment 130947 [details]
dmesg_W9000_with_custom_fence_debug.log


You are receiving this mail because:
  • You are the assignee for the bug.
= --14927013000.80755aDFc.28048-- --===============1353582747== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZHJpLWRldmVs IG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vZHJpLWRldmVsCg== --===============1353582747==-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: bugzilla-daemon@freedesktop.org Subject: [Bug 100712] ring 0 stalled after bytes_moved_threshold reached - CAPVERDE/HD7770 - TAHITI/W9000 Date: Thu, 20 Apr 2017 15:15:43 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0496228034==" Return-path: Received: from culpepper.freedesktop.org (culpepper.freedesktop.org [131.252.210.165]) by gabe.freedesktop.org (Postfix) with ESMTP id D163F6E5EE for ; Thu, 20 Apr 2017 15:15:43 +0000 (UTC) In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org --===============0496228034== Content-Type: multipart/alternative; boundary="14927013430.0c7bD751E.27825"; charset="UTF-8" --14927013430.0c7bD751E.27825 Date: Thu, 20 Apr 2017 15:15:43 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://bugs.freedesktop.org/ Auto-Submitted: auto-generated https://bugs.freedesktop.org/show_bug.cgi?id=3D100712 Julien Isorce changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|ring 0 stalled after |ring 0 stalled after |bytes_moved_threshold |bytes_moved_threshold |reached - Cap Verde - HD |reached - CAPVERDE/HD7770 - |7770 |TAHITI/W9000 --=20 You are receiving this mail because: You are the assignee for the bug.= --14927013430.0c7bD751E.27825 Date: Thu, 20 Apr 2017 15:15:43 +0000 MIME-Version: 1.0 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://bugs.freedesktop.org/ Auto-Submitted: auto-generated Julien Isorce changed bug 10071= 2
What Removed Added
Summary ring 0 stalled after bytes_moved_threshold reached - Cap Ver= de - HD 7770 ring 0 stalled after bytes_moved_threshold reached - CAPVERD= E/HD7770 - TAHITI/W9000


You are receiving this mail because:
  • You are the assignee for the bug.
= --14927013430.0c7bD751E.27825-- --===============0496228034== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZHJpLWRldmVs IG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vZHJpLWRldmVsCg== --===============0496228034==-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: bugzilla-daemon@freedesktop.org Subject: [Bug 100712] ring 0 stalled after bytes_moved_threshold reached - CAPVERDE/HD7770 - TAHITI/W9000 Date: Thu, 20 Apr 2017 15:23:22 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1268182892==" Return-path: Received: from culpepper.freedesktop.org (culpepper.freedesktop.org [131.252.210.165]) by gabe.freedesktop.org (Postfix) with ESMTP id 871A46E5F9 for ; Thu, 20 Apr 2017 15:23:22 +0000 (UTC) In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org --===============1268182892== Content-Type: multipart/alternative; boundary="14927018020.94fCEc.28681"; charset="UTF-8" --14927018020.94fCEc.28681 Date: Thu, 20 Apr 2017 15:23:22 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://bugs.freedesktop.org/ Auto-Submitted: auto-generated https://bugs.freedesktop.org/show_bug.cgi?id=3D100712 --- Comment #7 from Julien Isorce --- I made 2 apitrace using Zach's test mentioned here https://bugs.freedesktop.org/show_bug.cgi?id=3D100465#c24 . This test is al= so good to reproduce this ring 0 stalled issue. 1: apitrace ideal for vram size 2048 (ex: HD7770) https://drive.google.com/file/d/0Bzat_iFKrgCWYzBlZFFLQjgyRU0/view?usp=3Dsha= ring 2: apitrace ideal for vram size 6144 (ex: W9000) https://drive.google.com/file/d/0Bzat_iFKrgCWczgzM2FzaVFTUXc/view?usp=3Dsha= ring DISPLAY=3D:0 apitrace replay thrash.trace Also I have attached the log (dmesg_W9000_with_custom_fence_debug.log) I get with my dev branch here https://github.com/CapOM/linux/commits/amd-staging-4.9_add_debug_fences whe= re I added traces to debug ring N stalled issues. It prints the backtrace from w= here it waits for the fence and it also prints the backtrace from where it has emited that fence. Also note that setting R600_DEBUG=3Dnowc avoids this ring N stalled (so the endless fence is signaled). --=20 You are receiving this mail because: You are the assignee for the bug.= --14927018020.94fCEc.28681 Date: Thu, 20 Apr 2017 15:23:22 +0000 MIME-Version: 1.0 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://bugs.freedesktop.org/ Auto-Submitted: auto-generated

Commen= t # 7 on bug 10071= 2 from Julien Isorce
I made 2 apitrace using Zach's test mentioned here
https://bugs.freedesktop.org/show_=
bug.cgi?id=3D100465#c24 . This test is also
good to reproduce this ring 0 stalled issue.

1: apitrace ideal for vram size 2048 (ex: HD7770)
https://drive.google.com/file/d/0Bzat_iFKrgCWYzBlZFFLQjgyR=
U0/view?usp=3Dsharing

2: apitrace ideal for vram size 6144 (ex: W9000)
https://drive.google.com/file/d/0Bzat_iFKrgCWczgzM2FzaVFTU=
Xc/view?usp=3Dsharing

DISPLAY=3D:0 apitrace replay thrash.trace

Also I have attached the log (dmesg_W9000_with_custom_fence_debug.log) I get
with my dev branch here
https://github.com/CapOM/linux/commits/amd-staging-4.9_add_debug_f=
ences where I
added traces to debug ring N stalled issues. It prints the backtrace from w=
here
it waits for the fence and it also prints the backtrace from where it has
emited that fence.

Also note that setting R600_DEBUG=3Dnowc avoids this ring N stalled (so the
endless fence is signaled).


You are receiving this mail because:
  • You are the assignee for the bug.
= --14927018020.94fCEc.28681-- --===============1268182892== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZHJpLWRldmVs IG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vZHJpLWRldmVsCg== --===============1268182892==-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: bugzilla-daemon@freedesktop.org Subject: [Bug 100712] ring 0 stalled after bytes_moved_threshold reached - CAPVERDE/HD7770 - TAHITI/W9000 Date: Mon, 24 Apr 2017 11:02:33 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1872301534==" Return-path: Received: from culpepper.freedesktop.org (culpepper.freedesktop.org [131.252.210.165]) by gabe.freedesktop.org (Postfix) with ESMTP id 525C489C09 for ; Mon, 24 Apr 2017 11:02:33 +0000 (UTC) In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org --===============1872301534== Content-Type: multipart/alternative; boundary="14930317530.218BBE055.11413"; charset="UTF-8" --14930317530.218BBE055.11413 Date: Mon, 24 Apr 2017 11:02:33 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://bugs.freedesktop.org/ Auto-Submitted: auto-generated https://bugs.freedesktop.org/show_bug.cgi?id=3D100712 --- Comment #8 from Julien Isorce --- Hack submitted here https://patchwork.kernel.org/patch/9695945/. It contains some info in the commit message and in the replies. For those who want to t= ry, it is easier to just set R600_DEBUG=3Dnowc as said in #7. --=20 You are receiving this mail because: You are the assignee for the bug.= --14930317530.218BBE055.11413 Date: Mon, 24 Apr 2017 11:02:33 +0000 MIME-Version: 1.0 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://bugs.freedesktop.org/ Auto-Submitted: auto-generated

Commen= t # 8 on bug 10071= 2 from Julien Isorce
Hack submitted here https://patchwork.kernel.org/patch/9695945/. It contains
some info in the commit message and in the replies. For those who want to t=
ry,
it is easier to just set R600_DEBUG=3Dnowc as said in #7.


You are receiving this mail because:
  • You are the assignee for the bug.
= --14930317530.218BBE055.11413-- --===============1872301534== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZHJpLWRldmVs IG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vZHJpLWRldmVsCg== --===============1872301534==-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: bugzilla-daemon@freedesktop.org Subject: [Bug 100712] ring 0 stalled after bytes_moved_threshold reached - CAPVERDE/HD7770 - TAHITI/W9000 Date: Tue, 19 Nov 2019 09:28:23 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0407760418==" Return-path: Received: from culpepper.freedesktop.org (culpepper.freedesktop.org [IPv6:2610:10:20:722:a800:ff:fe98:4b55]) by gabe.freedesktop.org (Postfix) with ESMTP id 5C6F66F3FE for ; Tue, 19 Nov 2019 09:28:23 +0000 (UTC) In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org --===============0407760418== Content-Type: multipart/alternative; boundary="15741557032.E950B7D9.6147" Content-Transfer-Encoding: 7bit --15741557032.E950B7D9.6147 Date: Tue, 19 Nov 2019 09:28:23 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://bugs.freedesktop.org/ Auto-Submitted: auto-generated https://bugs.freedesktop.org/show_bug.cgi?id=3D100712 Martin Peres changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |MOVED Status|NEW |RESOLVED --- Comment #9 from Martin Peres --- -- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this = link to our GitLab instance: https://gitlab.freedesktop.org/drm/amd/issues/793. --=20 You are receiving this mail because: You are the assignee for the bug.= --15741557032.E950B7D9.6147 Date: Tue, 19 Nov 2019 09:28:23 +0000 MIME-Version: 1.0 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://bugs.freedesktop.org/ Auto-Submitted: auto-generated <= span class=3D"fn">Martin Peres changed bug 10071= 2
What Removed Added
Resolution --- MOVED
Status NEW RESOLVED

Commen= t # 9 on bug 10071= 2 from Martin Peres
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been
closed from further activity.

You can subscribe and participate further through the new bug through this =
link
to our GitLab instance: https://gitlab.freedesktop.org/drm/amd/issues/793.


You are receiving this mail because:
  • You are the assignee for the bug.
= --15741557032.E950B7D9.6147-- --===============0407760418== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZHJpLWRldmVs IG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vZHJpLWRldmVs --===============0407760418==--