[PATCH 2/2] drm/xe/ufence: Warn if mmget_not_zero() fails
Francois Dugast
francois.dugast at intel.com
Mon Oct 14 11:37:48 UTC 2024
On Mon, Oct 14, 2024 at 12:58:29PM +0200, Maarten Lankhorst wrote:
> I believe this is triggerable from userspace, so this should be a
> XE_IOCTL_DBG
Actually it seems this code is executed from the context of the worker (which
can be kicked from userspace). Besides, XE_IOCTL_DBG is used to check IOCTL
arguments, which I think is not really the case here. See:
$ git grep XE_IOCTL_DBG drivers/gpu/drm/xe
>
> Den 2024-10-14 kl. 11:27, skrev Francois Dugast:
> > On Fri, Oct 11, 2024 at 01:57:15PM +0200, Nirmoy Das wrote:
> > > This shouldn't happen but seen this while debugging ufence timeout
> > > issue time to time so log it to isolate this particular case.
> > >
> > > Link: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/1630
> > > Cc: Matthew Brost <matthew.brost at intel.com>
> > > Signed-off-by: Nirmoy Das <nirmoy.das at intel.com>
> >
> > Reviewed-by: Francois Dugast <francois.dugast at intel.com>
> >
> > > ---
> > > drivers/gpu/drm/xe/xe_sync.c | 2 ++
> > > 1 file changed, 2 insertions(+)
> > >
> > > diff --git a/drivers/gpu/drm/xe/xe_sync.c b/drivers/gpu/drm/xe/xe_sync.c
> > > index 6a2e4dd41d56..41758f528d7c 100644
> > > --- a/drivers/gpu/drm/xe/xe_sync.c
> > > +++ b/drivers/gpu/drm/xe/xe_sync.c
> > > @@ -83,6 +83,8 @@ static void user_fence_worker(struct work_struct *w)
> > > XE_WARN_ON("Copy to user failed");
> > > kthread_unuse_mm(ufence->mm);
> > > mmput(ufence->mm);
> > > + } else {
> > > + XE_WARN_ON("mmget_not_zero() failed");
> > > }
> > > wake_up_all(&ufence->xe->ufence_wq);
> > > --
> > > 2.46.0
> > >
>
More information about the Intel-xe
mailing list