mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Philipp Stanner <phasta@mailbox.org>
To: "Christian König" <christian.koenig@amd.com>,
	2564278112@qq.com, alexander.deucher@amd.com
Cc: airlied@gmail.com, simona@ffwll.ch,
	amd-gfx@lists.freedesktop.org,  dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org, Wang Jiang	 <jiangwang@kylinos.cn>,
	Philipp Stanner <phasta@kernel.org>,
	Danilo Krummrich	 <dakr@kernel.org>
Subject: Re: [PATCH] drm/radeon: restore hardware polling in fence_is_signaled to fix performance regression
Date: Wed, 05 Aug 2026 11:12:37 +0200	[thread overview]
Message-ID: <73de3de29ffbd36375a3a8d48f7ca840bf8f2d06.camel@mailbox.org> (raw)
In-Reply-To: <baa434d9-e0a9-482d-a071-42d204b82126@amd.com>

On Wed, 2026-08-05 at 10:34 +0200, Christian König wrote:
> On 7/29/26 12:26, 2564278112@qq.com wrote:
> > From: Wang Jiang <jiangwang@kylinos.cn>
> > 
> > Commit 9eb00b5f5697b ("drm/radeon: delete radeon_fence_process in
> > is_signaled, no deadlock") removed the hardware polling from
> > radeon_fence_is_signaled() to fix a self-deadlock caused by
> > wake_up_all(&rdev->fence_queue) being called with the fence queue
> > lock held.
> > 
> > However, removing the polling entirely causes significant performance
> > regression (e.g. glxgears FPS drop) because the fence signaled check
> > becomes purely passive — it only reads the cached last_seq without
> > probing the GPU, so completed GPU work is not detected in time,
> > causing unnecessary CPU stalls in sync-heavy workloads.
> > 
> > Fix this by calling radeon_fence_activity() directly instead of
> > radeon_fence_process(). radeon_fence_activity() reads the hardware
> > fence counter and updates last_seq via atomic ops without calling
> > wake_up_all(), thus avoiding the deadlock while restoring timely
> > fence detection.
> 
> Yeah I already feared that removing this in commit 9eb00b5f5697b
> could cause issues.
> 
> Adding Philip and Danilo since we recently had a discussion about the
> necessity of this.

necessity of avoiding deadlocks with the callbacks somehow, or the
necessity for opportunistic signaling?


What we were wondering about was

a) who can even reach the hardware_fence when the gpu scheduler's fence
is in between and

b) why it might be a problem if we lock in dma_fence_is_signaled(),
because it would mean that someone (e.g. in userspace) is busy-looping
on the fence.


Since radeon does not use drm_sched, it seems to be one example for a),
I can see that.


Regards
P.

  reply	other threads:[~2026-08-05  9:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-29 10:26 2564278112
2026-08-05  8:34 ` Christian König
2026-08-05  9:12   ` Philipp Stanner [this message]
2026-08-05 13:39   ` Alex Deucher

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=73de3de29ffbd36375a3a8d48f7ca840bf8f2d06.camel@mailbox.org \
    --to=phasta@mailbox.org \
    --cc=2564278112@qq.com \
    --cc=airlied@gmail.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=christian.koenig@amd.com \
    --cc=dakr@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jiangwang@kylinos.cn \
    --cc=linux-kernel@vger.kernel.org \
    --cc=phasta@kernel.org \
    --cc=simona@ffwll.ch \
    /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

all inboxes | Powered by JetHome®