kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Zhenyu Wang <zhenyuw@linux.intel.com>
To: "Tian, Kevin" <kevin.tian@intel.com>
Cc: "alex.williamson@redhat.com" <alex.williamson@redhat.com>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	"intel-gvt-dev@lists.freedesktop.org" 
	<intel-gvt-dev@lists.freedesktop.org>,
	"Jiang, Dave" <dave.jiang@intel.com>,
	"Yuan, Hang" <hang.yuan@intel.com>
Subject: Re: [PATCH v2 2/2] drm/i915/gvt: mdev aggregation type
Date: Fri, 27 Mar 2020 16:58:25 +0800	[thread overview]
Message-ID: <20200327085825.GK8880@zhen-hp.sh.intel.com> (raw)
In-Reply-To: <AADFC41AFE54684AB9EE6CBC0274A5D19D7ED38D@SHSMSX104.ccr.corp.intel.com>

[-- Attachment #1: Type: text/plain, Size: 3416 bytes --]

On 2020.03.27 08:44:59 +0000, Tian, Kevin wrote:
> > From: Zhenyu Wang <zhenyuw@linux.intel.com>
> > Sent: Friday, March 27, 2020 4:12 PM
> > 
> [...]
> > > > +int intel_vgpu_adjust_resource_count(struct intel_vgpu *vgpu)
> > > > +{
> > > > +	if ((vgpu_aperture_sz(vgpu) != vgpu->param.low_gm_sz *
> > > > +	     vgpu->param.aggregation) ||
> > > > +	    (vgpu_hidden_sz(vgpu) != vgpu->param.high_gm_sz *
> > > > +	     vgpu->param.aggregation)) {
> > > > +		/* handle aggregation change */
> > > > +		intel_vgpu_free_resource_count(vgpu);
> > > > +		intel_vgpu_alloc_resource_count(vgpu);
> > >
> > > this logic sounds like different from the commit msg. Earlier you
> > > said the resource is not allocated until mdev open, while the
> > > aggregated_interfaces is only allowed to be written before
> > > mdev open. In such case, why would it required to handle the
> > > case where a vgpu already has resource allocated then coming
> > > a new request to adjust the number of instances?
> > 
> > This is to handle resource accounting before mdev open by aggregation
> > setting change. When vgpu create from mdev type, default resource
> > count according to type is set for vgpu. So this function is just to
> > change resource count by aggregation.
> 
> then better change the name, e.g. .xxx_adjust_resource_accounting,
> otherwise it's easy to be confused.
>

ok

> [...]
> > > >  	if (ret)
> > > >  		goto out_clean_vgpu_mmio;
> > > >
> > > > -	populate_pvinfo_page(vgpu);
> > > > +	if (!delay_res_alloc) {
> > > > +		ret = intel_vgpu_res_alloc(vgpu);
> > > > +		if (ret)
> > > > +			goto out_clean_vgpu_mmio;
> > > > +	}
> > >
> > > If delayed resource allocation works correctly, why do we still
> > > need support non-delayed flavor? Even a type doesn't support
> > > aggregation, it doesn't hurt to do allocation until mdev open...
> > >
> > 
> > The difference is user expectation I think, if there's really
> > awareness of this. As original way is to allocate at creat time, so
> > once created success, resource is guaranteed. But for aggregation type
> > which could be changed before open, alloc happens at that time which
> > may have different scenario, e.g might fail caused by other instance
> > or host. So original idea is to keep old behavior but only change for
> > aggregation type.
> 
> but how could one expect any difference between instant allocation
> and delayed allocation? You already update resource accounting so
> the remaining instances are accurate anyway. Then the user only knows
> how the vgpu looks like when it is opened...
> 
> > 
> > If we think this user expectation is not important, delayed alloc
> > could help to create vgpu quickly but may have more chance to fail
> > later..
> > 
> 
> why? If delayed allocation has more chance to fail, it means our
> resource accounting has problem. Even for type w/o aggregation
> capability, we should reserve one instance resource by default anyway
> 

If under really heavy load of host and many other vgpu running, we
might not have left continual gfx mem space..This is not new problem,
just that now we handle it at vgpu create time to reserve the
resource. Once host side could promise some limit, then our usage
will be guaranteed.

-- 
Open Source Technology Center, Intel ltd.

$gpg --keyserver wwwkeys.pgp.net --recv-keys 4D781827

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

  reply	other threads:[~2020-03-27  9:11 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-26  5:41 [PATCH v2 0/2] VFIO mdev aggregated resources handling Zhenyu Wang
2020-03-26  5:41 ` [PATCH v2 1/2] Documentation/driver-api/vfio-mediated-device.rst: update for aggregation support Zhenyu Wang
2020-03-26  8:17   ` Tian, Kevin
2020-03-26  8:21     ` Zhenyu Wang
2020-03-27  6:16       ` Tian, Kevin
2020-03-27  6:21         ` Zhenyu Wang
2020-03-26  5:41 ` [PATCH v2 2/2] drm/i915/gvt: mdev aggregation type Zhenyu Wang
2020-03-27  7:48   ` Tian, Kevin
2020-03-27  8:12     ` Zhenyu Wang
2020-03-27  8:44       ` Tian, Kevin
2020-03-27  8:58         ` Zhenyu Wang [this message]
2020-03-27  9:31           ` Tian, Kevin
2020-04-08  5:58 ` [PATCH v3 0/2] VFIO mdev aggregated resources handling Zhenyu Wang
2020-07-07 23:28   ` Tian, Kevin
2020-07-08  1:06     ` Alex Williamson
2020-07-08  1:54       ` Zhenyu Wang
2020-07-08  3:38         ` Yan Zhao
2020-07-08  3:40           ` Yan Zhao
2020-07-08  4:17             ` Alex Williamson
2020-07-08  6:31       ` Tian, Kevin
2020-07-08  9:54         ` Zhenyu Wang
2020-07-08 18:48         ` Alex Williamson
2020-07-09  2:53           ` Tian, Kevin
2020-07-09  7:23             ` Yan Zhao
2020-07-09 20:22               ` Alex Williamson
2020-07-10  1:58                 ` Yan Zhao
2020-07-10 15:00                   ` Alex Williamson
2020-07-09 17:28             ` Alex Williamson
2020-07-10  2:09               ` Tian, Kevin
2020-07-10  6:29                 ` Yan Zhao
2020-07-10 15:12                   ` Alex Williamson
2020-07-13  0:59                     ` Yan Zhao
2020-04-08  5:58 ` [PATCH v3 1/2] Documentation/driver-api/vfio-mediated-device.rst: update for aggregation support Zhenyu Wang
2020-04-08  5:58 ` [PATCH v3 2/2] drm/i915/gvt: mdev aggregation type Zhenyu Wang

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=20200327085825.GK8880@zhen-hp.sh.intel.com \
    --to=zhenyuw@linux.intel.com \
    --cc=alex.williamson@redhat.com \
    --cc=dave.jiang@intel.com \
    --cc=hang.yuan@intel.com \
    --cc=intel-gvt-dev@lists.freedesktop.org \
    --cc=kevin.tian@intel.com \
    --cc=kvm@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).