All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Zhang, Xiaolin" <xiaolin.zhang@intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>,
	"intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>,
	"intel-gvt-dev@lists.freedesktop.org"
	<intel-gvt-dev@lists.freedesktop.org>
Cc: "Wang, Zhenyu Z" <zhenyu.z.wang@intel.com>,
	"Yuan, Hang" <hang.yuan@intel.com>,
	"Lv, Zhiyuan" <zhiyuan.lv@intel.com>
Subject: Re: [PATCH v5 4/8] drm/i915: vgpu context submission pv optimization
Date: Tue, 21 May 2019 08:26:39 +0000	[thread overview]
Message-ID: <073732E20AE4C540AE91DBC3F07D4460876606C1@SHSMSX107.ccr.corp.intel.com> (raw)
In-Reply-To: 155653215521.27886.14694707069719603445@skylake-alporthouse-com

On 04/29/2019 06:03 PM, Chris Wilson wrote:
> Quoting Xiaolin Zhang (2019-04-29 04:10:54)
>> +static void pv_submit(struct intel_engine_cs *engine)
>> +{
>> +       struct intel_engine_execlists * const execlists = &engine->execlists;
>> +       struct execlist_port *port = execlists->port;
>> +       unsigned int n;
>> +       struct gvt_shared_page *shared_page = engine->i915->vgpu.shared_page;
>> +       u64 descs[2];
>> +
>> +       for (n = 0; n < execlists_num_ports(execlists); n++) {
>> +               struct i915_request *rq;
>> +               unsigned int count = 0;
>> +
>> +               descs[n] = 0;
>> +               rq = port_unpack(&port[n], &count);
>> +               if (rq && count == 0) {
>> +                       port_set(&port[n], port_pack(rq, ++count));
>> +                       descs[n] = execlists_update_context(rq);
>> +               }
>> +       }
>> +
>> +       spin_lock(&engine->i915->vgpu.shared_page_lock[engine->id]);
> Only one engine at a time now accesses that portion of pv_elsp, so the
> spin lock is not required per-se, aiui.
>
> The problem is that there is no coordination between pv_submit and the
> other side of the pipe, as far as I can see. So it seems very possible
> for us to overwrite entries before they have been read. I expect to see
> some ack mechanism for VGT_G2V_PV_SUBMISSION.
>
>> +       for (n = 0; n < execlists_num_ports(execlists); n++)
>> +               shared_page->pv_elsp[engine->id].descs[n] = descs[n];
> I'd recommend not using engine->id, that's just our internal id and may
> vary between host/guest. Use engine->hw_id? Or negotiate using pv setup
> and store pv_id?
>
> But starting to look more solid over all. We just need to finish
> splitting out the various similar-but-quite-different-really submission
> backends. :)
> -Chris
>
Chris, Thanks your great comments and will be addressed next version
(will remove spin lock, use hw_id,  add ack mechanism and refine patches). 
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2019-05-21  8:26 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-29  3:10 [PATCH v5 0/8] i915 vgpu PV to improve vgpu performance Xiaolin Zhang
2019-04-29  3:10 ` [PATCH v5 1/8] drm/i915: introduced vgpu pv capability Xiaolin Zhang
2019-04-29  3:10 ` [PATCH v5 2/8] drm/i915: vgpu shared memory setup for pv optimization Xiaolin Zhang
2019-04-30  2:34   ` Zhenyu Wang
2019-04-29  3:10 ` [PATCH v5 3/8] drm/i915: vgpu ppgtt update " Xiaolin Zhang
2019-04-29  3:10 ` [PATCH v5 4/8] drm/i915: vgpu context submission " Xiaolin Zhang
2019-04-29 10:02   ` Chris Wilson
2019-05-21  8:26     ` Zhang, Xiaolin [this message]
2019-04-29  3:10 ` [PATCH v5 5/8] drm/i915/gvt: GVTg handle pv_caps PVINFO register Xiaolin Zhang
2019-04-29  3:10 ` [PATCH v5 6/8] drm/i915/gvt: GVTg handle shared_page setup Xiaolin Zhang
2019-04-29  3:10 ` [PATCH v5 7/8] drm/i915/gvt: GVTg support ppgtt pv optimization Xiaolin Zhang
2019-04-29  3:10 ` [PATCH v5 8/8] drm/i915/gvt: GVTg support context submission " Xiaolin Zhang
2019-04-29 12:30 ` ✗ Fi.CI.CHECKPATCH: warning for i915 vgpu PV to improve vgpu performance Patchwork
2019-04-29 12:34 ` ✗ Fi.CI.SPARSE: " Patchwork
2019-04-29 12:57 ` ✓ Fi.CI.BAT: success " Patchwork
2019-04-29 16:55 ` ✓ Fi.CI.IGT: " 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=073732E20AE4C540AE91DBC3F07D4460876606C1@SHSMSX107.ccr.corp.intel.com \
    --to=xiaolin.zhang@intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=hang.yuan@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-gvt-dev@lists.freedesktop.org \
    --cc=zhenyu.z.wang@intel.com \
    --cc=zhiyuan.lv@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.