From: "Dixit, Ashutosh" <ashutosh.dixit@intel.com>
To: Lucas De Marchi <lucas.demarchi@intel.com>
Cc: "José Roberto de Souza" <jose.souza@intel.com>,
intel-xe@lists.freedesktop.org
Subject: Re: [PATCH 3/3] drm/xe/oa: Destroy dangling oa streams when xe_file is removed
Date: Thu, 15 Aug 2024 13:40:22 -0700 [thread overview]
Message-ID: <875xs1eczt.wl-ashutosh.dixit@intel.com> (raw)
In-Reply-To: <b7wpmfrqkk4mjguhu7ecadtlkkbwaxyywajuedzeaai7yoaca5@dme6wvhaoci4>
On Thu, 15 Aug 2024 11:17:05 -0700, Lucas De Marchi wrote:
>
Hi Jose,
> On Thu, Aug 15, 2024 at 09:27:58AM GMT, Jose Souza wrote:
> > If an application opens an oa stream and for whatever reason it don't
> > close the stream the oa unit associeted with it will never be release,
> > so no other application can use it.
> > The only workaround was to unload the driver or reboot.
The premise of this patch and the need for it seems misplaced. How are you
reproducing this?
OA stream open returns a fd. Whether or not the process closes the stream,
fd will get closed on process exit, which triggers the the release method
(xe_oa_release(), specified in xe_oa_fops), which does the cleanup and
makes the OA unit available again. I just verified this works without
closing the OA stream or reloading the module.
> > So here adding a list of oa stream and and when a xe_file is closed
> > it will also destroy all oa stream with the same xe_file.
We will also need to explain why something like this was never needed in
i915, since this mechanism is the same between i915 and xe.
> >
> > Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
> > ---
> > drivers/gpu/drm/xe/xe_device.c | 2 ++
> > drivers/gpu/drm/xe/xe_oa.c | 28 +++++++++++++++++++++++++++-
> > drivers/gpu/drm/xe/xe_oa.h | 1 +
> > drivers/gpu/drm/xe/xe_oa_types.h | 8 ++++++++
> > 4 files changed, 38 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/xe/xe_device.c b/drivers/gpu/drm/xe/xe_device.c
> > index 2063283871503..b098685ed3636 100644
> > --- a/drivers/gpu/drm/xe/xe_device.c
> > +++ b/drivers/gpu/drm/xe/xe_device.c
> > @@ -158,6 +158,8 @@ static void xe_file_close(struct drm_device *dev, struct drm_file *file)
> >
> > xe_pm_runtime_get(xe);
> >
> > + xe_oa_file_destroy_stream(xef);
>
> I'm not sure about this impl giving xef for oa to delete from a list,
> will leave the to Ashutosh. Comment below about a mistake though
>
> > static int xe_oa_alloc_oa_buffer(struct xe_oa_stream *stream)
> > @@ -1480,11 +1484,15 @@ static int xe_oa_stream_open_ioctl_locked(struct xe_oa *oa,
> > goto exit;
> > }
> >
> > + stream->xef = param->xef;
>
> if you keep a pointer to xef, you need to get a ref. Use
> xe_file_get()/xe_file_put().
Done here:
https://patchwork.freedesktop.org/patch/607603/?series=137058&rev=1
Thanks.
--
Ashutosh
next prev parent reply other threads:[~2024-08-15 20:47 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-15 16:27 [PATCH 1/3] drm/xe/oa: Replace per GT oa mutex per a global one José Roberto de Souza
2024-08-15 16:27 ` [PATCH 2/3] drm/xe/oa: Remove the drm device reference of oa_stream in xe_oa_destroy_locked() José Roberto de Souza
2024-08-15 16:27 ` [PATCH 3/3] drm/xe/oa: Destroy dangling oa streams when xe_file is removed José Roberto de Souza
2024-08-15 18:17 ` Lucas De Marchi
2024-08-15 20:40 ` Dixit, Ashutosh [this message]
2024-08-15 16:33 ` ✓ CI.Patch_applied: success for series starting with [1/3] drm/xe/oa: Replace per GT oa mutex per a global one Patchwork
2024-08-15 16:33 ` ✗ CI.checkpatch: warning " Patchwork
2024-08-15 16:34 ` ✓ CI.KUnit: success " Patchwork
2024-08-15 16:42 ` [PATCH 1/3] " Matthew Brost
2024-08-15 21:11 ` Dixit, Ashutosh
2024-08-15 16:46 ` ✓ CI.Build: success for series starting with [1/3] " Patchwork
2024-08-15 16:48 ` ✗ CI.Hooks: failure " Patchwork
2024-08-15 16:50 ` ✓ CI.checksparse: success " Patchwork
2024-08-15 17:34 ` ✗ CI.BAT: failure " Patchwork
2024-08-15 18:31 ` ✗ CI.FULL: " Patchwork
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=875xs1eczt.wl-ashutosh.dixit@intel.com \
--to=ashutosh.dixit@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=jose.souza@intel.com \
--cc=lucas.demarchi@intel.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