From: Greg KH <gregkh@linuxfoundation.org>
To: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org, christian.koenig@amd.com,
Honglei Huang <honghuan@amd.com>
Subject: Re: [PATCH] drm/amdgpu: drop retry loop in amdgpu_hmm_range_get_pages
Date: Tue, 16 Jun 2026 18:50:56 +0530 [thread overview]
Message-ID: <2026061646-ship-culpable-1e01@gregkh> (raw)
In-Reply-To: <20260616130531.738887-1-alexander.deucher@amd.com>
On Tue, Jun 16, 2026 at 09:05:31AM -0400, Alex Deucher wrote:
> From: Honglei Huang <honghuan@amd.com>
>
> Since commit c08972f55594 ("drm/amdgpu: fix amdgpu_hmm_range_get_pages")
> moved mmu_interval_read_begin() out of the per-chunk loop, the
> captured notifier_seq is no longer refreshed across retries. As a
> result, the existing -EBUSY retry path can never make progress:
>
> hmm_range_fault() returns -EBUSY only when
> mmu_interval_check_retry(notifier, notifier_seq) reports that the
> sequence is stale. Once the sequence has advanced, the stored seq
> will never match again, so every subsequent call within the same
> invocation returns -EBUSY immediately.
>
> The "goto retry" therefore degenerates into a busy spin that simply
> burns CPU for the full HMM_RANGE_DEFAULT_TIMEOUT (~1s) window before
> finally bailing out with -EAGAIN. This is pure latency with no chance
> of recovery, and it actively hurts the KFD userptr stack: the caller
> ends up blocked for a second while holding mmap_lock, only to return
> -EAGAIN to the restore worker (or to userspace) which would have
> re-driven the operation immediately anyway.
>
> Drop the retry/timeout entirely and let -EBUSY propagate straight to
> out_free_pfns, where it is already translated to -EAGAIN. Recovery is
> handled at a higher level: the KFD restore_userptr_worker reschedules
> itself, and the userptr ioctl path returns -EAGAIN to userspace.
>
> No functional regression: the previous behaviour on -EBUSY was already
> to fail with -EAGAIN after a 1s stall; we just skip the stall.
>
> Fixes: c08972f55594 ("drm/amdgpu: fix amdgpu_hmm_range_get_pages")
This commit is not anywhere...
next prev parent reply other threads:[~2026-06-16 13:22 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-16 13:05 [PATCH] drm/amdgpu: drop retry loop in amdgpu_hmm_range_get_pages Alex Deucher
2026-06-16 13:20 ` Greg KH
2026-06-18 22:30 ` Deucher, Alexander
2026-06-16 13:20 ` Greg KH [this message]
2026-06-18 9:08 ` 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=2026061646-ship-culpable-1e01@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=alexander.deucher@amd.com \
--cc=christian.koenig@amd.com \
--cc=honghuan@amd.com \
--cc=stable@vger.kernel.org \
/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