AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Gang Ba <gaba@amd.com>
To: Jay Cornwall <jay.cornwall@amd.com>,
	"Russell, Kent" <Kent.Russell@amd.com>,
	"Ba, Gang" <Gang.Ba@amd.com>,
	"amd-gfx@lists.freedesktop.org" <amd-gfx@lists.freedesktop.org>
Subject: Re: [PATCH] drm/amdkfd: Fix TCP XNACK scoreboard reset race
Date: Tue, 1 Sep 2026 16:17:43 -0400	[thread overview]
Message-ID: <9a353fc4-6947-4a5b-bb37-ee6e17529ede@amd.com> (raw)
In-Reply-To: <037a59c6-f698-443b-9fe0-5fdcc23e9084@amd.com>

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


On 9/1/26 12:45, Jay Cornwall wrote:
> On 9/1/2026 08:04, Russell, Kent wrote:
>
>>> +     .hqd_gfx_cleaner = kgd_gfx_v9_cleaner
>
> Prefer a name like fault_cleaner. This is not related to a HQD.
>
will update


>>> +void kgd_gfx_v9_cleaner(struct amdgpu_device *adev)
>>> +{
>>> +     gfx_v9_4_2_shader_cleaner_workarounds(adev);
>
> Similarly, fault_cleaner.
>
will update
>>> +static void gfx942_workaround_cleaner(struct kfd_node *dev, 
>>> uint16_t pasid)
>
> Similarly, fault_cleaner
>
will update

>>> +     /* Run the GFX cleaner workaround on the faulting device.
>>> +      * Only run once per page fault (evicted == 1 after first evict).
>>> +      */
>>> +     pdd = kfd_get_process_device_data(dev, p);
>>> +     if (pdd) {
>>> +             /* Only call cleaner once per page fault. Run the 
>>> workaround
>>> +              * only on the first eviction (evicted == 1 after 
>>> evict above).
>>> +              */
>>> +             dqm = pdd->dev->dqm;
>>> +             dqm_lock(dqm);
>>> +             if (pdd->qpd.evicted == 1 && dqm->dev->kfd2kgd-
>>>> hqd_gfx_cleaner)
>>> + dqm->dev->kfd2kgd->hqd_gfx_cleaner(dqm->dev-
>>>> adev);
>>> +             dqm_unlock(dqm);
>>> +     }
>>> +
>>> +     /* Restore all process devices after workaround completes */
>
> I'm not sure that we want to do this. Once a process faults there is 
> no recovery path for its queues. If we restore them then other waves 
> may cause further faults, leading us back here.
>
> Similarly, if the workqueue contains pipelined fault interrupts we 
> don't want to do this multiple times. Perhaps check pdd->qpd.evicted 
> before evicting queues and only run the workaround if (evicted == 0).
The eviction and restoration functions feature built-in concurrency 
protection. If an eviction process is already underway, the function 
automatically bypasses the operation.

The function utilizes the "evicted" value (which can be updated to 
|pdd->qpd.evicted <= 1|) to prevent multiple concurrent executions of 
the cleaner function.


[-- Attachment #2: Type: text/html, Size: 5303 bytes --]

  reply	other threads:[~2026-09-01 20:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-31 20:50 [PATCH] drm/amdkfd: Fix TCP XNACK scoreboard reset race Gang Ba
2026-09-01 13:04 ` Russell, Kent
2026-09-01 16:45   ` Jay Cornwall
2026-09-01 20:17     ` Gang Ba [this message]
2026-09-01 21:04       ` Jay Cornwall

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=9a353fc4-6947-4a5b-bb37-ee6e17529ede@amd.com \
    --to=gaba@amd.com \
    --cc=Gang.Ba@amd.com \
    --cc=Kent.Russell@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=jay.cornwall@amd.com \
    /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