From: "Dixit, Ashutosh" <ashutosh.dixit@intel.com>
To: Harish Chegondi <harish.chegondi@intel.com>
Cc: intel-xe@lists.freedesktop.org, james.ausmus@intel.com,
felix.j.degrood@intel.com, matias.a.cabral@intel.com,
joshua.santosh.ranjan@intel.com, shubham.kumar@intel.com,
matthew.d.roper@intel.com, matthew.olson@intel.com
Subject: Re: [PATCH v6 2/7] drm/xe/uapi: Introduce API for EU stall sampling
Date: Thu, 19 Dec 2024 12:54:11 -0800 [thread overview]
Message-ID: <85o7171jik.wl-ashutosh.dixit@intel.com> (raw)
In-Reply-To: <Z2SCKvfqjruxRnQp@intel.com>
On Thu, 19 Dec 2024 12:29:30 -0800, Harish Chegondi wrote:
>
> On Thu, Dec 19, 2024 at 08:27:56AM -0800, Dixit, Ashutosh wrote:
> > On Wed, 18 Dec 2024 14:51:34 -0800, Harish Chegondi wrote:
> > >
> > > On Tue, Dec 17, 2024 at 12:35:15PM -0800, Dixit, Ashutosh wrote:
> > > > On Tue, 17 Dec 2024 01:46:52 -0800, Harish Chegondi wrote:
> > > > >
> > > >
> > > > Hi Harish,
> > > >
> > > > Only reviewing the uapi once again.
> > > >
> > > > > A user space consumer for this feature is Mesa.
> > > > >
> > > > > Mesa PR: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30142
> > > >
> > > > Mesa PR should be in the cover letter, not in the patch itself. And we'll
> > > > need to eventually show that the Mesa PR is consuming all aspects of the
> > > > uapi being introduced.
> > > Okay, will fix in the next patch series. Mesa PR still need some uAPI
> > > changes I made in this patch series.
> > > >
> > > > >
> > > > > v6: Change the input sampling rate to GPU cycles instead of
> > > > > GPU cycles multiplier.
> > > >
> > > > Note that if your series is v6 each patch in the series is not necessarily
> > > > v6. A patch can be v2 e.g. So you should capture the version and changelog
> > > > of each patch separately.
> > > Makes sense. But how would the reviewers know if a patch v2 in a series
> > > v6 has been updated?
> >
> > They can check, say in v7 if the patch has gone from v2 to v3. And anyway
> > reviewers need to be aware of what is going on. There should be no
> > significant changes to the patch after a R-b, otherwise typically the patch
> > will change and it versions increment.
> >
> > With what you are doing, the patch will go from v6 to v7 even if there are
> > no changes to the patch.
> When I do a git format-patch, I specify the --subject-prefix="PATCH version".
> Since this is a patch series, all the patches in the series will be
> assigned the new version even though I don't change some of the patches
> in the series. Is there a way I can specify the version for individual patches?
I do everything manually. However, looking at the patches in:
https://patchwork.freedesktop.org/series/137870/
Matt Brost seems to be doing what you are doing, so that should be ok too.
> >
> > > >
> > > > > diff --git a/include/uapi/drm/xe_drm.h b/include/uapi/drm/xe_drm.h
> > > > > index f62689ca861a..4ee3b04a1bb5 100644
> > > > > --- a/include/uapi/drm/xe_drm.h
> > > > > +++ b/include/uapi/drm/xe_drm.h
> > > > > @@ -1397,6 +1397,8 @@ struct drm_xe_wait_user_fence {
> > > > > enum drm_xe_observation_type {
> > > > > /** @DRM_XE_OBSERVATION_TYPE_OA: OA observation stream type */
> > > > > DRM_XE_OBSERVATION_TYPE_OA,
> > > > > + /** @DRM_XE_OBSERVATION_TYPE_EU_STALL: EU stall sampling observation stream type */
> > > > > + DRM_XE_OBSERVATION_TYPE_EU_STALL,
> > > > > };
> > > > >
> > > > > /**
> > > > > @@ -1729,6 +1731,45 @@ struct drm_xe_oa_stream_info {
> > > > > __u64 reserved[3];
> > > > > };
> > > > >
> > > > > +/**
> > > > > + * enum drm_xe_eu_stall_property_id - EU stall sampling input property ids.
> > > > > + *
> > > > > + * These properties are passed to the driver at open as a chain of
> > > > > + * @drm_xe_ext_set_property structures with @property set to these
> > > > > + * properties' enums and @value set to the corresponding values of these
> > > > > + * properties. @drm_xe_user_extension base.name should be set to
> > > > > + * @DRM_XE_EU_STALL_EXTENSION_SET_PROPERTY.
> > > > > + *
> > > > > + * With the file descriptor obtained from open, user space must enable
> > > > > + * the EU stall stream fd with @DRM_XE_OBSERVATION_IOCTL_ENABLE before
> > > > > + * calling read(). read() returns number of bytes of EU stall data read
> > > > > + * from the EU stall data buffer or an error. One of the errors returned
> > > >
> > > > No need to explain what read() returns, read() is a system call, user can
> > > > read the read man page.
> > > >
> > > > > + * from read is -EIO which indicates HW dropped data due to full buffer.
> > > >
> > > > Just say "EIO errno from read() indicates data loss due to buffer
> > > > overflow".
> > > >
> > > > Also, -EIO is not returned to userspace, errno is set for userspace.
> > > >
> > > > > + *
> > > > > + */
> > > > > +enum drm_xe_eu_stall_property_id {
> > > > > +#define DRM_XE_EU_STALL_EXTENSION_SET_PROPERTY 0
> > > > > + /**
> > > > > + * @DRM_XE_EU_STALL_PROP_GT_ID: GT ID of the GT on which
> > > >
> > > > @gt_id
> > > >
> > > > > + * EU stall data will be captured.
> > > > > + */
> > > > > + DRM_XE_EU_STALL_PROP_GT_ID = 1,
> > > > > +
> > > > > + /**
> > > > > + * @DRM_XE_EU_STALL_PROP_SAMPLE_RATE: Sampling rate
> > > > > + * in GPU cycles. Valid values are:
> > > > > + * 251, 251x2, 251x3, 251x4, 251x5, 251x6 and 251x7.
> > > >
> > > > This 251 stuff needs to go, as was already mentioned the last
> > > > time. Something like:
> > > >
> > > > "@DRM_XE_EU_STALL_PROP_SAMPLE_RATE: Sampling rate in GPU cycles, from
> > > > @sampling_rates in struct @drm_xe_query_eu_stall".
> > > Will change.
> > > >
> > > > > + */
> > > > > + DRM_XE_EU_STALL_PROP_SAMPLE_RATE,
> > > > > +
> > > > > + /**
> > > > > + * @DRM_XE_EU_STALL_PROP_EVENT_REPORT_COUNT: Minimum number of
> > > > > + * EU stall data rows to be present in the kernel buffer for
> > > > > + * poll() to set POLLIN (data present).
> > > > > + */
> > > > > + DRM_XE_EU_STALL_PROP_EVENT_REPORT_COUNT,
> > > >
> > > > We called this DRM_XE_OA_PROPERTY_WAIT_NUM_REPORTS for OA. So maybe
> > > > DRM_XE_EU_STALL_PROP_WAIT_NUM_REPORTS? Or WAIT_REPORT_COUNT? Not sure what
> > > > EVENT is referring to?
> > > Here is EVENT is referring to POLLIN (new EU stall data in the buffer)
> > > from poll(). This property would specify the minimum EU stall data
> > > records to be present in the buffer for poll() to set POLLIN.
> >
> > Note that above I said use EIO errno, not -EIO return code? The reason for
> > that is that this is userspace facing file, to be consumed by
> > userspace. Userspace doesn't know what POLLIN/EVENT mean, those things are
>
> Userspace knows POLLIN - https://man7.org/linux/man-pages/man2/poll.2.html
Ah ok. And poll has events too. Though we need to cover both the
non-blocking as well as blocking read cases. Blocking read does not set
POLLIN.
>
> > internal to the kernel implemenation and kernel API's. So these need to be
> > changed too. Here is the example from OA for this property:
> >
> > /**
> > * @DRM_XE_OA_PROPERTY_WAIT_NUM_REPORTS: Number of reports to wait
> > * for before unblocking poll or read
> > */
> > DRM_XE_OA_PROPERTY_WAIT_NUM_REPORTS,
> >
> > So here there is no mention of kernel implementation/API's, only about user
> > threads getting unblocked. And anyway there are no events to userspace
> > kernel is sending.
>
> If I remember correctly, the name event report count was suggested by
> the user space folks. I can change it so it is consistent with the term
> used in OA to DRM_XE_EU_STALL_PROP_WAIT_NUM_REPORTS.
>
> >
> > > >
> > > > > +};systemctl start gdm3
> > >
> > > > > +
> > > > > #if defined(__cplusplus)
> > > > > }
> > > > > #endif
> > > > > --
> > > > > 2.47.0
> > > > >
> > > >
> > > > Ashutosh
> > > Thank you
> > > Harish.
> > >
next prev parent reply other threads:[~2024-12-19 20:54 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-17 9:46 [PATCH v6 0/7] Add support for EU stall sampling Harish Chegondi
2024-12-17 9:46 ` [PATCH v6 1/7] drm/xe/topology: Add a function to find the index of the last enabled DSS in a mask Harish Chegondi
2024-12-17 9:46 ` [PATCH v6 2/7] drm/xe/uapi: Introduce API for EU stall sampling Harish Chegondi
2024-12-17 20:35 ` Dixit, Ashutosh
2024-12-18 22:51 ` Harish Chegondi
2024-12-19 16:27 ` Dixit, Ashutosh
2024-12-19 20:29 ` Harish Chegondi
2024-12-19 20:53 ` Raag Jadav
2024-12-19 20:54 ` Dixit, Ashutosh [this message]
2024-12-17 9:46 ` [PATCH v6 3/7] drm/xe/eustall: Implement EU stall sampling APIs for Xe_HPC Harish Chegondi
2024-12-17 9:46 ` [PATCH v6 4/7] drm/xe/eustall: Return -EIO error from read() if HW drops data Harish Chegondi
2024-12-17 9:46 ` [PATCH v6 5/7] drm/xe/eustall: Add EU stall sampling support for Xe2 Harish Chegondi
2024-12-17 9:46 ` [PATCH v6 6/7] drm/xe/uapi: Add a device query to get EU stall sampling information Harish Chegondi
2024-12-17 20:07 ` Dixit, Ashutosh
2024-12-18 23:24 ` Harish Chegondi
2024-12-19 16:36 ` Dixit, Ashutosh
2024-12-19 20:04 ` Harish Chegondi
2024-12-19 20:15 ` Dixit, Ashutosh
2024-12-19 20:19 ` Dixit, Ashutosh
2024-12-17 9:46 ` [PATCH v6 7/7] drm/xe/eustall: Add workaround 22016596838 which applies to PVC Harish Chegondi
2024-12-17 15:35 ` ✓ CI.Patch_applied: success for Add support for EU stall sampling Patchwork
2024-12-17 15:35 ` ✗ CI.checkpatch: warning " Patchwork
2024-12-17 15:37 ` ✓ CI.KUnit: success " Patchwork
2024-12-17 15:55 ` ✓ CI.Build: " Patchwork
2024-12-17 15:57 ` ✗ CI.Hooks: failure " Patchwork
2024-12-17 15:58 ` ✓ CI.checksparse: success " Patchwork
2024-12-17 16:32 ` ✓ Xe.CI.BAT: " Patchwork
2024-12-18 0:47 ` ✗ Xe.CI.Full: failure " 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=85o7171jik.wl-ashutosh.dixit@intel.com \
--to=ashutosh.dixit@intel.com \
--cc=felix.j.degrood@intel.com \
--cc=harish.chegondi@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=james.ausmus@intel.com \
--cc=joshua.santosh.ranjan@intel.com \
--cc=matias.a.cabral@intel.com \
--cc=matthew.d.roper@intel.com \
--cc=matthew.olson@intel.com \
--cc=shubham.kumar@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).