From: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
To: "Li, Weinan Z" <weinan.z.li@intel.com>,
"intel-gfx@lists.freedesktop.org"
<intel-gfx@lists.freedesktop.org>,
"intel-gvt-dev@lists.freedesktop.org"
<intel-gvt-dev@lists.freedesktop.org>
Subject: Re: [PATCH v3] drm/i915/gvt: return the actual aperture size under gvt environment
Date: Tue, 09 May 2017 15:35:40 +0300 [thread overview]
Message-ID: <1494333340.7069.4.camel@linux.intel.com> (raw)
In-Reply-To: <9BD218709B5F2A4F96F08B4A3B98A8976855058C@SHSMSX101.ccr.corp.intel.com>
On ti, 2017-05-09 at 03:10 +0000, Li, Weinan Z wrote:
> > > > @@ -242,6 +242,9 @@ int intel_vgt_balloon(struct drm_i915_private
> > > > *dev_priv)
> > > > goto err;
> > > > }
> > > >
> > > > + for (i = 0; i < ARRAY_SIZE(bl_info.space); i++)
> > > > + ggtt->base.reserved += bl_info.space[i].size;
> > > > +
> >
> > There should be an equal decrease when deballooning is done. And for that to
> > be correct, you need to add proper onion teardown to this function to make
> > sure the count stays correct (can't call deballoon on failure or the count will
> > become negative which will result in huge number marked as reserved).
> Oh, that's my fault. Should add clean up in intel_vgt_deballoon().
> @@ -114,6 +114,7 @@ void intel_vgt_deballoon(struct drm_i915_private *dev_priv)
> }
>
> memset(&bl_info, 0, sizeof(bl_info));
> + dev_priv->ggtt.reserved = 0;
> }
> Since if any steps in intel_vgt_balloon() fail, it will deal as error and run
> intel_vgt_deballoon() for clean up, no partial success happen.
> So we only calculate the reserved when balloon success, it can ensure it's correct.
Onion teardown should be used according to kernel coding style, there's
really no excuse not to.
Just add to the ggtt->base.reserved in increments, and remove in
increments during teardown or in the deballoon function. ggtt.reserved
is not exclusively for GVT-g to use, so you can't simply zero it. There
needs to be incremental additions and substractions as objects are
added and removed for the variable to stay general.
Regards, Joonas
--
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2017-05-09 12:35 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-03 0:51 [PATCH v3] drm/i915/gvt: return the actual aperture size under gvt environment Weinan Li
2017-05-03 1:16 ` ✓ Fi.CI.BAT: success for drm/i915/gvt: return the actual aperture size under gvt environment (rev3) Patchwork
2017-05-08 2:49 ` [PATCH v3] drm/i915/gvt: return the actual aperture size under gvt environment Li, Weinan Z
2017-05-08 10:18 ` Joonas Lahtinen
2017-05-08 12:10 ` Chris Wilson
2017-05-09 3:22 ` Li, Weinan Z
2017-05-09 3:10 ` Li, Weinan Z
2017-05-09 12:35 ` Joonas Lahtinen [this message]
2017-05-10 1:45 ` Li, Weinan Z
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=1494333340.7069.4.camel@linux.intel.com \
--to=joonas.lahtinen@linux.intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-gvt-dev@lists.freedesktop.org \
--cc=weinan.z.li@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.