regressions.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: "Christian König" <christian.koenig@amd.com>
To: Dan Moulding <dmoulding@me.com>, regressions@leemhuis.info
Cc: bskeggs@redhat.com, dri-devel@lists.freedesktop.org,
	nouveau@lists.freedesktop.org, regressions@lists.linux.dev,
	sf@sfritsch.de
Subject: Re: [Nouveau] Regression in 5.15 in nouveau
Date: Tue, 7 Dec 2021 10:52:00 +0100	[thread overview]
Message-ID: <6f62bd8c-3a2c-e553-898c-d42fb1583208@amd.com> (raw)
In-Reply-To: <20211206183721.6495-1-dmoulding@me.com>

[-- Attachment #1: Type: text/plain, Size: 1551 bytes --]

Am 06.12.21 um 19:37 schrieb Dan Moulding:
> On 04.12.21 17:40, Stefan Fritsch wrote:
>> Hi,
>>
>> when updating from 5.14 to 5.15 on a system with NVIDIA GP108 [GeForce
>> GT 1030] (NV138) and Ryzen 9 3900XT using kde/plasma on X (not wayland),
>> there is a regression: There is now some annoying black flickering in
>> some applications, for example thunderbird, firefox, or mpv. It mostly
>> happens when scrolling or when playing video. Only the window of the
>> application flickers, not the whole screen. But the flickering is not
>> limited to the scrolled area: for example in firefox the url and
>> bookmark bars flicker, too, not only the web site. I have bisected the
>> issue to this commit:
>>
>> commit 3e1ad79bf66165bdb2baca3989f9227939241f11 (HEAD)
> I have been experiencing this same issue since switching to 5.15. I
> can confirm that reverting the above mentioned commit fixes the issue
> for me. I'm on GP104 hardware (GeForce GTX 1070), also running KDE
> Plasma on X.

I'm still scratching my head what's going wrong here.

Either we trigger some performance problem because we now wait twice for 
submissions or nouveau is doing something very nasty and not syncing 
it's memory accesses correctly.

Attached is an only compile tested patch which might mitigate the first 
problem.

But if it's the second then nouveau has a really nasty design issue here 
and somebody with more background on that driver design needs to take a 
look.

Please test if that patch changes anything.

Thanks,
Christian.

>
> Cheers,
>
> -- Dan


[-- Attachment #2: 0001-drm-nouveau-wait-for-the-exclusive-fence-after-the-s.patch --]
[-- Type: text/x-patch, Size: 2321 bytes --]

From bcb86d62569c0131288c8b032f848f28f0178648 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Christian=20K=C3=B6nig?= <christian.koenig@amd.com>
Date: Tue, 7 Dec 2021 10:10:15 +0100
Subject: [PATCH] drm/nouveau: wait for the exclusive fence after the shared
 ones
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Always waiting for the exclusive fence resulted on some performance
regressions. So try to wait for the shared fences first, then the
exclusive fence should always be signaled already.

Signed-off-by: Christian König <christian.koenig@amd.com>
---
 drivers/gpu/drm/nouveau/nouveau_fence.c | 25 ++++++++++++-------------
 1 file changed, 12 insertions(+), 13 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nouveau_fence.c b/drivers/gpu/drm/nouveau/nouveau_fence.c
index 05d0b3eb3690..0947e332371b 100644
--- a/drivers/gpu/drm/nouveau/nouveau_fence.c
+++ b/drivers/gpu/drm/nouveau/nouveau_fence.c
@@ -353,15 +353,19 @@ nouveau_fence_sync(struct nouveau_bo *nvbo, struct nouveau_channel *chan, bool e
 
 		if (ret)
 			return ret;
-	}
 
-	fobj = dma_resv_shared_list(resv);
-	fence = dma_resv_excl_fence(resv);
+		fobj = NULL;
+	} else {
+		fobj = dma_resv_shared_list(resv);
+	}
 
-	if (fence) {
+	for (i = 0; (i < fobj ? fobj->shared_count : 0) && !ret; ++i) {
 		struct nouveau_channel *prev = NULL;
 		bool must_wait = true;
 
+		fence = rcu_dereference_protected(fobj->shared[i],
+						dma_resv_held(resv));
+
 		f = nouveau_local_fence(fence, chan->drm);
 		if (f) {
 			rcu_read_lock();
@@ -373,20 +377,13 @@ nouveau_fence_sync(struct nouveau_bo *nvbo, struct nouveau_channel *chan, bool e
 
 		if (must_wait)
 			ret = dma_fence_wait(fence, intr);
-
-		return ret;
 	}
 
-	if (!exclusive || !fobj)
-		return ret;
-
-	for (i = 0; i < fobj->shared_count && !ret; ++i) {
+	fence = dma_resv_excl_fence(resv);
+	if (fence) {
 		struct nouveau_channel *prev = NULL;
 		bool must_wait = true;
 
-		fence = rcu_dereference_protected(fobj->shared[i],
-						dma_resv_held(resv));
-
 		f = nouveau_local_fence(fence, chan->drm);
 		if (f) {
 			rcu_read_lock();
@@ -398,6 +395,8 @@ nouveau_fence_sync(struct nouveau_bo *nvbo, struct nouveau_channel *chan, bool e
 
 		if (must_wait)
 			ret = dma_fence_wait(fence, intr);
+
+		return ret;
 	}
 
 	return ret;
-- 
2.25.1


  reply	other threads:[~2021-12-07  9:52 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <da142fb9-07d7-24fe-4533-0247b8d16cdd@sfritsch.de>
2021-12-06 13:19 ` Regression in 5.15 in nouveau Thorsten Leemhuis
2021-12-06 13:41   ` Christian König
2021-12-06 18:37   ` [Nouveau] " Dan Moulding
2021-12-07  9:52     ` Christian König [this message]
2021-12-07 17:32       ` Karol Herbst
2021-12-07 18:30         ` Daniel Vetter
2021-12-07 19:01       ` Dan Moulding
2021-12-07 19:22         ` Stefan Fritsch
2021-12-07 20:45           ` Dan Moulding
2021-12-08 17:43             ` Stefan Fritsch
2021-12-09 10:25             ` Christian König
2021-12-21 17:24   ` Regression in 5.15 in nouveau #forregzbot Thorsten Leemhuis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6f62bd8c-3a2c-e553-898c-d42fb1583208@amd.com \
    --to=christian.koenig@amd.com \
    --cc=bskeggs@redhat.com \
    --cc=dmoulding@me.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=nouveau@lists.freedesktop.org \
    --cc=regressions@leemhuis.info \
    --cc=regressions@lists.linux.dev \
    --cc=sf@sfritsch.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).