From: "Dixit, Ashutosh" <ashutosh.dixit@intel.com>
To: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: intel-xe@lists.freedesktop.org, Jose Souza <jose.souza@intel.com>,
Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
Subject: Re: [PATCH 07/17] drm/xe/oa: OA stream initialization (OAG)
Date: Tue, 28 May 2024 23:11:33 -0700 [thread overview]
Message-ID: <87v82xno4q.wl-ashutosh.dixit@intel.com> (raw)
In-Reply-To: <87wmndnrob.wl-ashutosh.dixit@intel.com>
On Tue, 28 May 2024 21:55:00 -0700, Dixit, Ashutosh wrote:
>
> On Tue, 28 May 2024 00:43:42 -0700, Lionel Landwerlin wrote:
> >
>
> Hi Lionel/Jose,
>
> > On 28/05/2024 10:16, Dixit, Ashutosh wrote:
> > > On Mon, 27 May 2024 23:39:50 -0700, Lionel Landwerlin wrote:
> > >> On 28/05/2024 09:17, Dixit, Ashutosh wrote:
> > >>> On Mon, 27 May 2024 22:47:13 -0700, Lionel Landwerlin wrote:
> > >>>
> > >>>> On 28/05/2024 08:27, Dixit, Ashutosh wrote:
> > >>>>> On Mon, 27 May 2024 00:04:21 -0700, Lionel Landwerlin wrote:
> > >>>>>
> > >>>>>>> +static int xe_oa_stream_init(struct xe_oa_stream *stream,
> > >>>>>>> + struct xe_oa_open_param *param)
> > >>>>>>> +{
> > >>>>> /snip/
> > >>>>>
> > >>>>>>> + stream->k_exec_q = xe_exec_queue_create(stream->oa->xe, NULL,
> > >>>>>>> + BIT(stream->hwe->logical_instance), 1,
> > >>>>>>> + stream->hwe, EXEC_QUEUE_FLAG_KERNEL, 0);
> > >>>>>> Hi Ashutosh,
> > >>>>>>
> > >>>>>> On i915 the changes of configuration were pipelined in the application's
> > >>>>>> execution just like any other submission.
> > >>>>>>
> > >>>>>> Creating another queue completely unsynchronized from the application's
> > >>>>>> submissions makes this non usable in my opinion.
> > >>>>> As we discussed previously, the plan here is to provide a drm_xe_sync array,
> > >>>>> through stream properties, which can use to synchronize OA programming with
> > >>>>> workload submisson.
> > >>>>>
> > >>>>> Would that not work? If not, we can do what was done in i915. But note that
> > >>>>> i915 still has unresolved hangs, which I believe are due to the spinner
> > >>>>> running on the application engine (iirc repeatedly opening/closing an OA
> > >>>>> stream will hang in i915, though it could be due to other i915
> > >>>>> complexity). That is why thought using drm_xe_sync array is both safer and
> > >>>>> more standard way of doing what we want to achieve.
> > >>>>>
> > >>>>> Basically the output sync object will be signalled after registers are
> > >>>>> programmed and also any additional OA programming delay (which is
> > >>>>> implemented in i915 using the spinner).
> > >>>>>
> > >>>>> This would be done both for OA stream open and changing OA stream
> > >>>>> configuration.
> > >>> That is true. But now that I have other stuff like gpuvis wrapped up, I
> > >>> plan to start looking these couple of missing uapi pieces (hold preemption
> > >>> and synchronization, likely in that order).
> > >>>
> > >>> Because synchronization is not implemented I add the delay below:
> > >>>
> > >>> static int xe_oa_emit_oa_config(struct xe_oa_stream *stream)
> > >>> {
> > >>> #define NOA_PROGRAM_ADDITIONAL_DELAY_US 500
> > >>> struct xe_oa_config_bo *oa_bo;
> > >>> int err, us = NOA_PROGRAM_ADDITIONAL_DELAY_US;
> > >>>
> > >>> oa_bo = xe_oa_alloc_config_buffer(stream);
> > >>> if (IS_ERR(oa_bo)) {
> > >>> err = PTR_ERR(oa_bo);
> > >>> goto exit;
> > >>> }
> > >>>
> > >>> err = xe_oa_submit_bb(stream, oa_bo->bb);
> > >>>
> > >>> /* Additional empirical delay needed for NOA programming after registers are written */
> > >>> usleep_range(us, 2 * us);
> > >>> exit:
> > >>> return err;
> > >>> }
> > >>>
> > >>> I need understand this is temporaty band-aid, since it stalls the
> > >>> submission pipeline and needs to be replaced by proper synchronization.
> > >>>
> > >>>> Just letting you know, because we cannot use the current ioctl because it
> > >>>> doesn't behave as we expect
> > >>> You wouldn't be able to merge the Mesa PR as per the current uapi now and
> > >>> then add additional Mesa patches, when we implement these couple of missing
> > >>> uapi features in KMD?
> > >>
> > >> We could merge only the stuff that parse the reports, that's enough to have
> > >> perfetto work.
> > > Hi Lionel, so this means the OAG buffer stuff, correct?
> >
> > Correct
> >
> > >> But all of the VK_KHR_performance_query won't work as far as I can tell.
> > > And this is the OAR stuff, synchronization and hold preemption?
> > >
> >
> > This is actually a mix of OAG/OAR. We do read a couple of OAG registers
> > that don't come as part of MI_REPORT_PERF_COUNT.
> >
> > We will need a way to tell when you've added the feature we need for
> > VK_KHR_performance_query.
> >
> > I don't think we want to test this at runtime given some of the ioctl
> > take time.
>
> Hmm, you mean like a version? We have capability bits in Xe and could
> potentially add a bit if needed. It is in the oa_unit query so like init
> time, not runtime.
Though, maybe, just not implement in mesa yet and implement it only after
KMD exposes that property? Till then say VK_KHR_performance_query is not
supported?
>
>
> > > Yes even if we can merge the OAG stuff first, that will get most of KMD OA
> > > code merged and then we can merge the remaining stuff later. Since it's a
> > > pain to maintain the code out of tree, that's why even if I can merge the
> > > OAG stuff (together with Mesa) which is the majority of the OA KMD code
> > > anyway, that would be a big relief.
>
> So, do you think you Mesa guys can give us an ack to merge the uapi we have
> now? And add the missing uapi bits in the second round of OA uapi changes?
> Or is there anything else you want us to do in this first round?
>
> For the second round, here is the list I have:
>
> * hold preemption (needs some investigation as to feasibility)
> * xe_sync for OA stream configuration and reconfiguration
> * Equivalent of DRM_I915_QUERY_PERF_CONFIG_DATA_FOR_UUID. I am still trying
> to figure out if this is really needed. See here:
>
> https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29312#note_2429650
>
> Since this seems to be using some MDAPI metrics in Mesa, I think it
> should be ok to do this in the second round too.
>
> Thanks.
> --
> Ashutosh
next prev parent reply other threads:[~2024-05-29 6:20 UTC|newest]
Thread overview: 54+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-27 1:43 [PATCH v15 00/17] Add OA functionality to Xe Ashutosh Dixit
2024-05-27 1:43 ` [PATCH 01/17] drm/xe/perf/uapi: "Perf" layer to support multiple perf counter stream types Ashutosh Dixit
2024-05-27 1:43 ` [PATCH 02/17] drm/xe/perf/uapi: Add perf_stream_paranoid sysctl Ashutosh Dixit
2024-05-27 1:43 ` [PATCH 03/17] drm/xe/oa/uapi: Add OA data formats Ashutosh Dixit
2024-06-20 17:28 ` Matt Roper
2024-06-20 17:57 ` Dixit, Ashutosh
2024-05-27 1:43 ` [PATCH 04/17] drm/xe/oa/uapi: Initialize OA units Ashutosh Dixit
2024-05-27 1:43 ` [PATCH 05/17] drm/xe/oa/uapi: Add/remove OA config perf ops Ashutosh Dixit
2024-05-27 1:43 ` [PATCH 06/17] drm/xe/oa/uapi: Define and parse OA stream properties Ashutosh Dixit
2024-05-27 1:43 ` [PATCH 07/17] drm/xe/oa: OA stream initialization (OAG) Ashutosh Dixit
2024-05-27 7:04 ` Lionel Landwerlin
2024-05-28 5:27 ` Dixit, Ashutosh
2024-05-28 5:47 ` Lionel Landwerlin
2024-05-28 6:17 ` Dixit, Ashutosh
2024-05-28 6:39 ` Lionel Landwerlin
2024-05-28 7:16 ` Dixit, Ashutosh
2024-05-28 7:43 ` Lionel Landwerlin
2024-05-29 4:55 ` Dixit, Ashutosh
2024-05-29 6:11 ` Dixit, Ashutosh [this message]
2024-05-29 6:29 ` Lionel Landwerlin
2024-05-27 1:43 ` [PATCH 08/17] drm/xe/oa/uapi: Expose OA stream fd Ashutosh Dixit
2024-05-27 1:43 ` [PATCH 09/17] drm/xe/oa/uapi: Read file_operation Ashutosh Dixit
2024-05-27 1:43 ` [PATCH 10/17] drm/xe/oa: Add OAR support Ashutosh Dixit
2024-05-27 1:43 ` [PATCH 11/17] drm/xe/oa: Add OAC support Ashutosh Dixit
2024-05-27 1:43 ` [PATCH 12/17] drm/xe/oa/uapi: Query OA unit properties Ashutosh Dixit
2024-05-27 1:43 ` [PATCH 13/17] drm/xe/oa/uapi: OA buffer mmap Ashutosh Dixit
2024-05-27 1:43 ` [PATCH 14/17] drm/xe/oa: Add MMIO trigger support Ashutosh Dixit
2024-05-27 1:43 ` [PATCH 15/17] drm/xe/oa: Override GuC RC with OA on PVC Ashutosh Dixit
2024-05-27 1:43 ` [PATCH 16/17] drm/xe/oa: Changes to OA_TAKEN Ashutosh Dixit
2024-05-27 1:43 ` [PATCH 17/17] drm/xe/oa: Enable Xe2+ overrun mode Ashutosh Dixit
2024-05-27 1:49 ` ✓ CI.Patch_applied: success for Add OA functionality to Xe (rev15) Patchwork
2024-05-27 1:49 ` ✗ CI.checkpatch: warning " Patchwork
2024-05-27 1:50 ` ✓ CI.KUnit: success " Patchwork
2024-05-27 2:02 ` ✓ CI.Build: " Patchwork
2024-05-27 2:04 ` ✓ CI.Hooks: " Patchwork
2024-05-27 2:06 ` ✓ CI.checksparse: " Patchwork
2024-05-27 2:31 ` ✓ CI.BAT: " Patchwork
2024-05-27 14:20 ` ✗ CI.FULL: failure " Patchwork
2024-06-05 14:12 ` [PATCH v15 00/17] Add OA functionality to Xe Souza, Jose
2024-06-06 19:56 ` Dixit, Ashutosh
2024-06-06 20:54 ` Dixit, Ashutosh
2024-06-14 15:12 ` Dixit, Ashutosh
2024-06-17 19:36 ` Rodrigo Vivi
2024-06-17 21:05 ` Dixit, Ashutosh
2024-06-17 21:14 ` Souza, Jose
2024-06-17 21:31 ` Rodrigo Vivi
2024-06-18 19:54 ` Dixit, Ashutosh
-- strict thread matches above, loose matches on Subject: below --
2024-06-18 1:45 [PATCH v19 " Ashutosh Dixit
2024-06-18 1:45 ` [PATCH 07/17] drm/xe/oa: OA stream initialization (OAG) Ashutosh Dixit
2024-06-17 22:36 [PATCH v18 00/17] Add OA functionality to Xe Ashutosh Dixit
2024-06-17 22:36 ` [PATCH 07/17] drm/xe/oa: OA stream initialization (OAG) Ashutosh Dixit
2024-06-12 2:05 [PATCH v17 00/17] Add OA functionality to Xe Ashutosh Dixit
2024-06-12 2:05 ` [PATCH 07/17] drm/xe/oa: OA stream initialization (OAG) Ashutosh Dixit
2024-06-07 20:43 [PATCH v16 00/17] Add OA functionality to Xe Ashutosh Dixit
2024-06-07 20:43 ` [PATCH 07/17] drm/xe/oa: OA stream initialization (OAG) Ashutosh Dixit
2024-05-24 19:01 [PATCH v14 00/17] Add OA functionality to Xe Ashutosh Dixit
2024-05-24 19:01 ` [PATCH 07/17] drm/xe/oa: OA stream initialization (OAG) Ashutosh Dixit
2024-03-15 1:35 [PATCH 00/17] Add OA functionality to Xe Ashutosh Dixit
2024-03-15 1:35 ` [PATCH 07/17] drm/xe/oa: OA stream initialization (OAG) Ashutosh Dixit
2024-03-12 3:38 [PATCH v12 00/17] Add OA functionality to Xe Ashutosh Dixit
2024-03-12 3:39 ` [PATCH 07/17] drm/xe/oa: OA stream initialization (OAG) Ashutosh Dixit
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=87v82xno4q.wl-ashutosh.dixit@intel.com \
--to=ashutosh.dixit@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=jose.souza@intel.com \
--cc=lionel.g.landwerlin@intel.com \
--cc=umesh.nerlige.ramappa@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;
as well as URLs for NNTP newsgroup(s).