[PATCH] drm/i915/gvt: implement per-vm mmio switching optimization
Dong, Chuanxiao
chuanxiao.dong at intel.com
Tue May 2 10:20:55 UTC 2017
> -----Original Message-----
> From: intel-gvt-dev [mailto:intel-gvt-dev-bounces at lists.freedesktop.org] On
> Behalf Of Du, Changbin
> Sent: Tuesday, May 2, 2017 6:09 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 02:53:43AM -0700, Dong, Chuanxiao wrote:
> > > > > according to the specific ring instead of all the rings? As
> > > > > after switch to VGPU, other rings may also be used by VGPU.
> > > > > >
> > > > > Seems this aways is our defaut policy so far. We only switch the
> > > > > ring which will be used, why switch other rings?
> > > >
> > > > The current switch policy is per request. If this request will use
> > > > RCS, only
> > > RCS is save/restore as other rings won't be touched. After switch to
> > > per-vm, a VM is possible that send a batch of requests to i915, and
> > > these requests may use different rings. So my understanding is after
> > > switch to per-vm, only save/restore for one ring is not enough.
> > > >
> > > No, you missundstand this 'per-vm'. We still switch mmio per
> > > request. What you think is not feasible if we must rely i915's scheduler.
> >
> > 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);
+ }
Thanks
Chuanxiao
More information about the intel-gvt-dev
mailing list