All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Dixit, Ashutosh" <ashutosh.dixit@intel.com>
To: Harish Chegondi <harish.chegondi@intel.com>
Cc: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>,
	intel-xe@lists.freedesktop.org,  james.ausmus@intel.com,
	felix.j.degrood@intel.com, jose.souza@intel.com,
	matias.a.cabral@intel.com, joshua.santosh.ranjan@intel.com,
	shubham.kumar@intel.com
Subject: Re: [PATCH v4 2/5] drm/xe/eustall: Introduce API for EU stall sampling
Date: Wed, 20 Nov 2024 11:04:28 -0800	[thread overview]
Message-ID: <851pz5loar.wl-ashutosh.dixit@intel.com> (raw)
In-Reply-To: <Zz0mUGCKzLXI5Y13@intel.com>

On Tue, 19 Nov 2024 15:59:12 -0800, Harish Chegondi wrote:
>
> > > +/**
> > > + * enum drm_xe_eu_stall_property_id - EU stall sampling input property ids.
> > > + *
> > > + * These properties are passed to the driver 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.
> > > + */
> > > +enum drm_xe_eu_stall_property_id {
> > > +#define DRM_XE_EU_STALL_EXTENSION_SET_PROPERTY		0
> > > +	/**
> > > +	 * @DRM_XE_EU_STALL_PROP_SAMPLE_RATE: Sampling rate
> > > +	 * in multiples of 251 cycles. Valid values are 1 to 7.
> > > +	 * If the value is 1, sampling interval is 251 cycles.
> > > +	 * If the value is 7, sampling interval is 7 x 251 cycles.
> > > +	 */
> > > +	DRM_XE_EU_STALL_PROP_SAMPLE_RATE = 1,
> >
> > What is the rate of 251 cycles? If that can be clearly defined, then at
> > first glance, I would think it's better to define this in terms of
> > frequency. The implementation can decide how to translate that to HW
> > configuration.
> >
> Since the duration of a cycle depends on the GPU clock, it can very from
> GPU to GPU. So, if there is any translation in the driver, it will have
> to be different for each GPU. I think keeping this input as a multiplier
> of cycles may be more future proof for the uAPI. I am trying to get more
> information and feedback from the user space regarding your suggestion.
> If it is feasible, I will implement in v6.

Umesh has a point but I sort of agree with Harish because this value is
directly fed into a register. But we do need some changes:

1. This 251 value showing up here doesn't make any sense and needs to go.
2. According to Bspec 64036, HW supports "127 * N" sampling rates
   (in terms of cycles), so we should support those too.
3. Even higher sampling rates (say 10x) are being proposed for the
   future. So these should also be supported.

So my proposal is simple, but let's see if it can be made to work. The uapi
will directly input the sampling rate in number of cycles (so the value
coming in is what the GPU freq is divided by). So e.g. if "3 * 251" is
required "3 * 251" will come in through the uapi. If UMD wants "7 * 127",
they will send in "7 * 127". The driver will internally map this value into
the "closest" sampling rate supported by HW.

I am assuming that UMD's already know what sampling rates are supported by
a particular HW platform so they can send in the exact value they
need. Otherwise the driver can always map the value sent by userspace. Say
UMD sends a value 10, this will be mapped into "1 * 127" which is the
closest sampling rate supported to 10.

So this way all sampling rates can be supported. UMD just says I want a
sampling rate of "GPU_freq divided by 10" and they automatically get
whatever is the closest available. They probably do need to have an idea of
what rates are supported on a particular HW platform, I am assuming they
have this information from Bspec, so they can send in exact values if they
know and driver will be able to set the exact value UMD has specified.

Ashutosh

  reply	other threads:[~2024-11-20 19:04 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-14  6:00 [PATCH v4 0/5] Add support for EU stall sampling Harish Chegondi
2024-10-14  6:00 ` [PATCH v4 1/5] drm/xe/topology: Add a function to find the index of the last DSS in a mask Harish Chegondi
2024-10-14 21:26   ` Dixit, Ashutosh
2024-10-16  3:44     ` Harish Chegondi
2024-10-18 21:26   ` Matt Roper
2024-10-14  6:00 ` [PATCH v4 2/5] drm/xe/eustall: Introduce API for EU stall sampling Harish Chegondi
2024-10-14 22:21   ` Dixit, Ashutosh
2024-10-18 22:03   ` Matt Roper
2024-11-14 16:23   ` Umesh Nerlige Ramappa
2024-11-19 23:59     ` Harish Chegondi
2024-11-20 19:04       ` Dixit, Ashutosh [this message]
2024-11-21  1:05         ` Umesh Nerlige Ramappa
2024-11-21  3:18           ` Dixit, Ashutosh
2024-11-22 18:18             ` Dixit, Ashutosh
2024-11-27 18:47               ` Harish Chegondi
2024-11-29  4:31                 ` Kumar, Shubham
2024-11-29  4:35                 ` Kumar, Shubham
2024-10-14  6:00 ` [PATCH v4 3/5] drm/xe/eustall: Implement EU stall sampling APIs Harish Chegondi
2024-10-18 23:31   ` Matt Roper
2024-10-14  6:00 ` [PATCH v4 4/5] drm/xe/query: Add a device query to get EU stall data information Harish Chegondi
2024-10-14 21:39   ` Dixit, Ashutosh
2024-10-14  6:00 ` [PATCH v4 5/5] drm/xe/eustall: Add workaround 22016596838 which applies to PVC Harish Chegondi
2024-10-14  6:05 ` ✓ CI.Patch_applied: success for Add support for EU stall sampling Patchwork
2024-10-14  6:05 ` ✗ CI.checkpatch: warning " Patchwork
2024-10-14  6:06 ` ✓ CI.KUnit: success " Patchwork
2024-10-14  6:18 ` ✓ CI.Build: " Patchwork
2024-10-14  6:20 ` ✗ CI.Hooks: failure " Patchwork
2024-10-14  6:22 ` ✓ CI.checksparse: success " Patchwork
2024-10-14  6:47 ` ✓ CI.BAT: " Patchwork
2024-10-14  7:54 ` ✗ 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=851pz5loar.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=jose.souza@intel.com \
    --cc=joshua.santosh.ranjan@intel.com \
    --cc=matias.a.cabral@intel.com \
    --cc=shubham.kumar@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.