All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Dixit, Ashutosh" <ashutosh.dixit@intel.com>
To: Matthew Brost <matthew.brost@intel.com>,
	Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
Cc: intel-xe@lists.freedesktop.org,
	Lionel Landwerlin <lionel.g.landwerlin@intel.com>,
	Jose Souza <jose.souza@intel.com>
Subject: Re: [PATCH 2/3] drm/xe: Exec queue op's to enable/disable preemption and timeslicing
Date: Tue, 25 Jun 2024 17:24:59 -0700	[thread overview]
Message-ID: <87le2sh7ok.wl-ashutosh.dixit@intel.com> (raw)
In-Reply-To: <Zns+LDMVXrBp04nU@DUT025-TGLU.fm.intel.com>

On Tue, 25 Jun 2024 15:01:16 -0700, Matthew Brost wrote:
>
> On Tue, Jun 25, 2024 at 02:57:15PM -0700, Umesh Nerlige Ramappa wrote:
> > On Tue, Jun 25, 2024 at 01:15:17PM -0700, Ashutosh Dixit wrote:
> > > +static int guc_exec_queue_set_no_preempt(struct xe_exec_queue *q)
> > > +{
> > > +	struct xe_sched_msg *msg;
> > > +
> > > +	if ((!q->sched_props.preempt_timeout_us && !q->sched_props.timeslice_us) ||
> > > +	    exec_queue_killed_or_banned_or_wedged(q))
> > > +		return 0;
> > > +
> > > +	msg = kmalloc(sizeof(*msg), GFP_KERNEL);
> > > +	if (!msg)
> > > +		return -ENOMEM;
> > > +
> > > +	/* Setting values to 0 will disable preemption and timeslicing */
> > > +	q->sched_props.preempt_timeout_us = 0;
> > > +	q->sched_props.timeslice_us = 0;
> > > +
> > > +	guc_exec_queue_add_msg(q, msg, SET_SCHED_PROPS);
> > > +
> > > +	return 0;
> > > +}
> > > +
> > > +static int guc_exec_queue_clear_no_preempt(struct xe_exec_queue *q)
> > > +{
> > > +	struct xe_sched_msg *msg;
> > > +
> > > +	if ((q->sched_props.preempt_timeout_us ==
> > > +	    q->hwe->eclass->sched_props.preempt_timeout_us &&
> > > +	    q->sched_props.timeslice_us == q->hwe->eclass->sched_props.timeslice_us) ||
> > > +	    exec_queue_killed_or_banned_or_wedged(q))
> > > +		return 0;
> > > +
> > > +	msg = kmalloc(sizeof(*msg), GFP_KERNEL);
> > > +	if (!msg)
> > > +		return -ENOMEM;
> > > +
> > > +	q->sched_props.preempt_timeout_us = q->hwe->eclass->sched_props.preempt_timeout_us;
> > > +	q->sched_props.timeslice_us = q->hwe->eclass->sched_props.timeslice_us;
> > > +
> > > +	guc_exec_queue_add_msg(q, msg, SET_SCHED_PROPS);
> > > +
> > > +	return 0;
> > > +}
> >
> > Why not just use the .set_timeslice and .set_preempt_timeout hooks instead
> > of defining a new one to do both?
> >
> Umesh's thinking seems correct.
>
> Just use the existing set_timeslice & set_preempt_timeout hooks with 0
> for disable and q->hwe->eclass->sched_props.timeslice_us for enable.

This was the approach I had taken in v1, I just resurrected v1 as v4 and
sent it out.

> > Also how do you check if this operation succeeeded? Is there a response from
> > GuC indicating success?
> >

.set_timeslice and .set_preempt_timeout have an error return. But otherwise
I don't know what happens after these ops call
guc_exec_queue_add_msg(). Maybe Matt Brost knows? Matt, is this operation
guaranteed to always succeed? Since there is no return code from these ops
except -ENOMEM.

Thanks.
--
Ashutosh


>
> Matt
>
> > Thanks,
> > Umesh
> >
> > > +
> > > static int guc_exec_queue_suspend(struct xe_exec_queue *q)
> > > {
> > >	struct xe_sched_msg *msg = q->guc->static_msgs + STATIC_MSG_SUSPEND;
> > > @@ -1598,6 +1641,8 @@ static const struct xe_exec_queue_ops guc_exec_queue_ops = {
> > >	.set_priority = guc_exec_queue_set_priority,
> > >	.set_timeslice = guc_exec_queue_set_timeslice,
> > >	.set_preempt_timeout = guc_exec_queue_set_preempt_timeout,
> > > +	.set_no_preempt = guc_exec_queue_set_no_preempt,
> > > +	.clear_no_preempt = guc_exec_queue_clear_no_preempt,
> > >	.suspend = guc_exec_queue_suspend,
> > >	.suspend_wait = guc_exec_queue_suspend_wait,
> > >	.resume = guc_exec_queue_resume,
> > > --
> > > 2.41.0
> > >

  reply	other threads:[~2024-06-26  0:29 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-25 20:15 [PATCH 0/3] drm/xe/oa: Add NO_PREEMPT property Ashutosh Dixit
2024-06-25 20:15 ` [PATCH 1/3] drm/xe/oa: Allow stream enable/disable functions to return error Ashutosh Dixit
2024-06-25 21:53   ` Umesh Nerlige Ramappa
2024-06-25 20:15 ` [PATCH 2/3] drm/xe: Exec queue op's to enable/disable preemption and timeslicing Ashutosh Dixit
2024-06-25 21:57   ` Umesh Nerlige Ramappa
2024-06-25 22:01     ` Matthew Brost
2024-06-26  0:24       ` Dixit, Ashutosh [this message]
2024-06-26  0:35         ` Matthew Brost
2024-06-25 20:15 ` [PATCH 3/3] drm/xe/oa: Allow preemption to be disabled on the stream exec queue Ashutosh Dixit
2024-06-25 20:49   ` Souza, Jose
2024-06-26  0:29     ` Dixit, Ashutosh
2024-06-25 21:55   ` Umesh Nerlige Ramappa
2024-06-25 22:02     ` Matthew Brost
2024-06-25 20:37 ` ✓ CI.Patch_applied: success for drm/xe/oa: Add NO_PREEMPT property (rev3) Patchwork
2024-06-25 20:37 ` ✓ CI.checkpatch: " Patchwork
2024-06-25 20:38 ` ✓ CI.KUnit: " Patchwork
2024-06-25 20:50 ` ✓ CI.Build: " Patchwork
2024-06-25 20:52 ` ✓ CI.Hooks: " Patchwork
2024-06-25 20:53 ` ✓ CI.checksparse: " Patchwork
2024-06-25 21:16 ` ✓ CI.BAT: " Patchwork
2024-06-26  1:48 ` ✗ 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=87le2sh7ok.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=matthew.brost@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.