[PATCH 4/4] drm/amdgpu/userq: integrate with enforce isolation

Alex Deucher alexdeucher at gmail.com
Mon Apr 14 19:04:15 UTC 2025


On Mon, Apr 14, 2025 at 1:58 PM Khatri, Sunil <sukhatri at amd.com> wrote:
>
> If i am not wrong @arvind  is already having the patch to remove this
> config. Should we use the function pointer check as being used in EOP
> and SDMA functions ?

The list will be empty if there are no user queues active.  Although,
thinking about it more, we only need to stop gfx and compute queues
for enforce isolation.  I will rework the patches.

Alex

>
> Regards
> Sunil Khatri
>
> On 4/14/2025 10:42 PM, Alex Deucher wrote:
> > Enforce isolation serializes access to the GFX IP.  User
> > queues are isolated in the MES scheduler, but we still
> > need to serialize between kernel queues and user queues.
> > For enforce isolation, group KGD user queues with KFD user
> > queues.
> >
> > v2: split out variable renaming, add config guards
> >
> > Signed-off-by: Alex Deucher <alexander.deucher at amd.com>
> > ---
> >   drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c | 6 ++++++
> >   1 file changed, 6 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
> > index c58d32983c45e..71c8b30b1659c 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
> > @@ -1970,6 +1970,9 @@ static void amdgpu_gfx_kfd_sch_ctrl(struct amdgpu_device *adev, u32 idx,
> >               if (adev->gfx.userq_sch_req_count[idx] == 0) {
> >                       cancel_delayed_work_sync(&adev->gfx.enforce_isolation[idx].work);
> >                       if (!adev->gfx.userq_sch_inactive[idx]) {
> > +#ifdef CONFIG_DRM_AMDGPU_NAVI3X_USERQ
> > +                             amdgpu_userq_stop_sched(adev, idx);
> > +#endif
> >                               if (adev->kfd.init_complete)
> >                                       amdgpu_amdkfd_stop_sched(adev, idx);
> >                               adev->gfx.userq_sch_inactive[idx] = true;
> > @@ -2027,6 +2030,9 @@ void amdgpu_gfx_enforce_isolation_handler(struct work_struct *work)
> >               /* Tell KFD to resume the runqueue */
> >               WARN_ON_ONCE(!adev->gfx.userq_sch_inactive[idx]);
> >               WARN_ON_ONCE(adev->gfx.userq_sch_req_count[idx]);
> > +#ifdef CONFIG_DRM_AMDGPU_NAVI3X_USERQ
> > +             amdgpu_userq_start_sched(adev, idx);
> > +#endif
> >               if (adev->kfd.init_complete)
> >                       amdgpu_amdkfd_start_sched(adev, idx);
> >               adev->gfx.userq_sch_inactive[idx] = false;


More information about the amd-gfx mailing list