[PATCH] drm/i915/gvt: implement per-vm mmio switching optimization
Dong, Chuanxiao
chuanxiao.dong at intel.com
Tue May 2 11:03:32 UTC 2017
> -----Original Message-----
> From: Du, Changbin
> Sent: Tuesday, May 2, 2017 6:22 PM
> To: Dong, Chuanxiao <chuanxiao.dong at intel.com>
> Cc: Du, Changbin <changbin.du at intel.com>; intel-gvt-
> dev at lists.freedesktop.org; Du at freedesktop.org; changbin.du at gmail.com
> Subject: Re: [PATCH] drm/i915/gvt: implement per-vm mmio switching
> optimization
>
> On Tue, May 02, 2017 at 03:20:55AM -0700, Dong, Chuanxiao wrote:
> > > > Eh....With per-vm switching, the switching between the VMs should
> > > > be
> > > something like:
> > > >
> > > > Host i915 req0 (RCS) --- host i915 req1 (BCS) --- host i915 req2
> > > > (RCS)
> > > > --- mmio switching to vgpu1 --- vgpu1 req0 (RCS) --- vgpu1 req1
> > > > (BCS)
> > > > --- "mmio switching to host" --- host i915 req 3(BCS)
> > > >
> > > This case make sense. The sencond ring will not be switched. It is a
> problem.
> > > May need a per-ring flag here.
> > >
> > > > Based on your patch, "mmio switching to vgpu1" will only save the
> > > > RCS
> > > mmio, right? Then vgpu1 req1 comes and uses the BCS which is not
> > > saved by "mmio switching to vgpu1". When "mmio switching to host",
> > > and your patch will restore the BCS for host which is actually not saved
> before...
> > > >
> > > Will not restore BCS, but just missed the mmio switch for BCS. RCS
> > > will be restored.
> >
> > No, actually you will restore based on the next i915 request's "req->engine-
> >id" which is BCS but not the ring id (RCS) saved at the previous mmio
> switching in this case.
> > + if (!is_gvt_request(req)) {
> > + if (action == INTEL_CONTEXT_SCHEDULE_IN && scheduler-
> >last_vgpu) {
> > + /* Switch from vGPU to host. */
> > + intel_gvt_switch_mmio(scheduler->last_vgpu, NULL,
> > + req->engine->id);
> > + }
> >
> It only restore last_ring, please check intel_gvt_switch_mmio().
>
I see, Thanks for the clarify. But please re-consider how to properly do the save/restore for the 'per-vm' switching otherwise may involve more issues.
Thanks
Chuanxiao
More information about the intel-gvt-dev
mailing list