[PATCH] drm/i915/gvt: implement per-vm mmio switching optimization

Dong, Chuanxiao chuanxiao.dong at intel.com
Tue May 2 09:53:43 UTC 2017



> -----Original Message-----
> From: Du, Changbin
> Sent: Tuesday, May 2, 2017 5:37 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 01:50:24AM -0700, Dong, Chuanxiao wrote:
> >
> > > > > -void intel_gvt_load_render_mmio(struct intel_vgpu *vgpu, int
> > > > > ring_id)
> > > > > +static void switch_mmio_to_vgpu(struct intel_vgpu *vgpu, int
> > > > > +ring_id)
> > > >
> > > > As it is per-vm switching, is it really OK to only save/restore
> > > > the mmio
> > > 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)

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...

Thanks
Chuanxiao

> 
> 
> > Thanks
> > Chuanxiao
> >
> > >
> > >
> 
> --
> Thanks,
> Changbin Du


More information about the intel-gvt-dev mailing list