All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yu Dai <yu.dai@intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 3/5] drm/i915/guc: Add GuC ADS - scheduler policies
Date: Thu, 17 Dec 2015 10:36:02 -0800	[thread overview]
Message-ID: <56730092.6060902@intel.com> (raw)
In-Reply-To: <20151217073956.GC14895@nuc-i3427.alporthouse.com>



On 12/16/2015 11:39 PM, Chris Wilson wrote:
> On Wed, Dec 16, 2015 at 01:40:53PM -0800, yu.dai@intel.com wrote:
> > From: Alex Dai <yu.dai@intel.com>
> >
> > GuC supports different scheduling policies for its four internal
> > queues. Currently these have been set to the same default values
> > as KMD_NORMAL queue.
> >
> > Particularly POLICY_MAX_NUM_WI is set to 15 to match GuC internal
> > maximum submit queue numbers to avoid an out-of-space problem.
> > This value indicates max number of work items allowed to be queued
> > for one DPC process. A smaller value will let GuC schedule more
> > frequently while a larger number may increase chances to optimize
> > cmds (such as collapse cmds from same lrc) with risks that keeps
> > CS idle.
> >
> > Signed-off-by: Alex Dai <yu.dai@intel.com>
> > ---
> >  drivers/gpu/drm/i915/i915_guc_submission.c | 31 +++++++++++++++++++-
> >  drivers/gpu/drm/i915/intel_guc_fwif.h      | 45 ++++++++++++++++++++++++++++++
> >  2 files changed, 75 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/i915/i915_guc_submission.c b/drivers/gpu/drm/i915/i915_guc_submission.c
> > index 66d85c3..a5c555c 100644
> > --- a/drivers/gpu/drm/i915/i915_guc_submission.c
> > +++ b/drivers/gpu/drm/i915/i915_guc_submission.c
> > @@ -842,17 +842,39 @@ static void guc_create_log(struct intel_guc *guc)
> >  	guc->log_flags = (offset << GUC_LOG_BUF_ADDR_SHIFT) | flags;
> >  }
> >
> > +static void init_guc_policies(struct guc_policies *policies)
> > +{
> > +	struct guc_policy *policy;
> > +	u32 p, i;
> > +
> > +	policies->dpc_promote_time = 500000;
> > +	policies->max_num_work_items = POLICY_MAX_NUM_WI;
> > +
> > +	for (p = 0; p < GUC_CTX_PRIORITY_NUM; p++)
> > +	for (i = 0; i < I915_NUM_RINGS; i++) {
>
> Please indent this properly.
>
> > +		policy = &policies->policy[p][i];
> > +
> > +		policy->execution_quantum = 1000000;
> > +		policy->preemption_time = 500000;
> > +		policy->fault_time = 250000;
> > +		policy->policy_flags = 0;
> > +	}
> > +
> > +	policies->is_valid = 1;
> > +}
> > +
> >  static void guc_create_ads(struct intel_guc *guc)
> >  {
> >  	struct drm_i915_private *dev_priv = guc_to_i915(guc);
> >  	struct drm_i915_gem_object *obj;
> >  	struct guc_ads *ads;
> > +	struct guc_policies *policies;
> >  	struct intel_engine_cs *ring;
> >  	struct page *page;
> >  	u32 size, i;
> >
> >  	/* The ads obj includes the struct itself and buffers passed to GuC */
> > -	size = sizeof(struct guc_ads);
> > +	size = sizeof(struct guc_ads) + sizeof(struct guc_policies);
> >
> >  	obj = guc->ads_obj;
> >  	if (!obj) {
> > @@ -884,6 +906,13 @@ static void guc_create_ads(struct intel_guc *guc)
> >  	for_each_ring(ring, dev_priv, i)
> >  		ads->eng_state_size[i] = intel_lr_context_size(ring);
> >
> > +	/* GuC scheduling policies */
> > +	policies = (void *)ads + sizeof(struct guc_ads);
> > +	init_guc_policies(policies);
>
> Please limit atomic context to only the critical section, i.e. don't
> make me have to read every single function to check for violations.

Could you clarify this? I am not sure what's the atomic context and 
critical section you mentioned here.

Alex
> > +
> > +	ads->scheduler_policies = i915_gem_obj_ggtt_offset(obj) +
> > +			sizeof(struct guc_ads);
> > +
> >  	kunmap_atomic(ads);
>

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2015-12-17 18:39 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-16 21:40 [PATCH 0/5] Add GuC ADS (Addition Data Structure) yu.dai
2015-12-16 21:40 ` [PATCH 1/5] drm/i915/guc: Expose (intel)_lr_context_size() yu.dai
2015-12-16 21:40 ` [PATCH 2/5] drm/i915/guc: Add GuC ADS (Addition Data Structure) - allocation yu.dai
2015-12-17  7:19   ` Chris Wilson
2015-12-17 18:55   ` [PATCH v1] " yu.dai
2015-12-17 19:36     ` kbuild test robot
2015-12-16 21:40 ` [PATCH 3/5] drm/i915/guc: Add GuC ADS - scheduler policies yu.dai
2015-12-17  7:39   ` Chris Wilson
2015-12-17 18:36     ` Yu Dai [this message]
2015-12-17 20:48       ` Chris Wilson
2015-12-16 21:40 ` [PATCH 4/5] drm/i915/guc: Add GuC ADS - MMIO reg state yu.dai
2015-12-16 21:40 ` [PATCH 5/5] drm/i915/guc: Add GuC ADS - enabling ADS yu.dai

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=56730092.6060902@intel.com \
    --to=yu.dai@intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    /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.