public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: "Goel, Akash" <akash.goel@intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>,
	Praveen Paneri <praveen.paneri@intel.com>,
	intel-gfx@lists.freedesktop.org, akash.goel@intel.com
Subject: Re: [PATCH] drm/i915: Unbind objects in shrinker only if device is runtime active
Date: Thu, 24 Dec 2015 20:12:46 +0530	[thread overview]
Message-ID: <567C0466.60506@intel.com> (raw)
In-Reply-To: <20151224143249.GD20608@nuc-i3427.alporthouse.com>



On 12/24/2015 8:02 PM, Chris Wilson wrote:
> On Thu, Dec 24, 2015 at 07:54:09PM +0530, Goel, Akash wrote:
>>
>>
>> On 12/24/2015 5:52 PM, Chris Wilson wrote:
>>> On Thu, Dec 24, 2015 at 04:16:08PM +0530, Praveen Paneri wrote:
>>>> When the system is running low on memory, gem shrinker is invoked.
>>>> In this process objects will be unbounded from GTT and unbinding process
>>>> will require access to GTT(GTTADR) and also to fence register potentially.
>>>> That requires a resume of gfx device, if suspended, in the shrinker path.
>>>> Considering the power leakage due to intermediate resume, perform unbinding
>>>> operation only if device is already runtime active.
>>>>
>>>> Signed-off-by: Akash Goel <akash.goel@intel.com>
>>>> Signed-off-by: Praveen Paneri <praveen.paneri@intel.com>
>>>> Cc: Chris Wilson <chris@chris-wilson.co.uk>
>>>
>>> Lgtm, the only complication is that we over report the number of
>>> shrinkable objects. But that isn't such a big issue with the current
>>> incarnation of the shrinker.
>>>
>>>> ---
>>>>   drivers/gpu/drm/i915/i915_gem_shrinker.c | 11 +++++++++++
>>>>   1 file changed, 11 insertions(+)
>>>>
>>>> diff --git a/drivers/gpu/drm/i915/i915_gem_shrinker.c b/drivers/gpu/drm/i915/i915_gem_shrinker.c
>>>> index f7df54a..89350f4 100644
>>>> --- a/drivers/gpu/drm/i915/i915_gem_shrinker.c
>>>> +++ b/drivers/gpu/drm/i915/i915_gem_shrinker.c
>>>> @@ -89,6 +89,15 @@ i915_gem_shrink(struct drm_i915_private *dev_priv,
>>>>   	i915_gem_retire_requests(dev_priv->dev);
>>>>
>>>>   	/*
>>>> +	 * Unbinding of objects will require HW access. Lets not wake
>>>> +	 * up gfx device just for this. Do the unbinding only if gfx
>>>> +	 * device is already active.
>>>> +	 */
>>>> +	if ((flags & I915_SHRINK_BOUND) &&
>>>> +			!intel_runtime_pm_get_noidle(dev_priv))
>>>
>>> Please line up contnuation lines with the opening bracking, hint cino=:0,(0 for vim.
>>>
>>> With the whitespace fixed,
>>> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
>>>
>>> /* Unbinding of objects will require HW access; let us not wake up
>>>   * the device just to recover a little memory. If absolutely necessary,
>>>   * we will force the wake during oom-notifier.
>>>   */
>>
>> Sorry not fully sure but do we need to cover
>> i915_gem_retire_requests() also ?
>
> No. That is covered by the dev_priv->mm.busy wakeref.
>
>> Actually retire_requests could also lead to a potential unbinding,
>> if the last reference of a context goes away in that.
>
> Indeed, also last object unreference could trigger an unbinding, and
> even last vma use. All covered by the dev_priv->mm.busy wakeref held
> whilst there are any requests in flight.
>
Thank you so much for the clarification.
So if the device is in a runtime suspended state, the call to 
i915_gem_retire_requests() should almost be a NOOP.

Best regards
Akash

>> There is a runtime_pm_get protection in i915_gem_free_object, so
>> should not be a problem for ringbuffer & context image objects and
>> most probably the i915_gem_context_clean would get completed before
>> the device again goes into runtime suspend state.
>
> No the one in i915_gem_free_object is actually wrong (granularity), and
> hopefully will be fixed in the near future.
> -Chris
>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2015-12-24 14:42 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-17  5:29 [PATCH] drm/i915: Skip shrinking of fenced objects if Gfx is suspended Praveen Paneri
2015-12-17  7:25 ` Chris Wilson
2015-12-24 10:46   ` [PATCH] drm/i915: Unbind objects in shrinker only if device is runtime active Praveen Paneri
2015-12-24 11:08     ` kbuild test robot
2015-12-24 12:22     ` Chris Wilson
2015-12-24 14:24       ` Goel, Akash
2015-12-24 14:32         ` Chris Wilson
2015-12-24 14:42           ` Goel, Akash [this message]
2015-12-24 14:48             ` Chris Wilson
2015-12-29  7:05               ` [PATCH 1/2] " Praveen Paneri
2015-12-29  7:05                 ` [PATCH 2/2] drm/i915: Add rpm get/put in i915_shrinker_oom Praveen Paneri
2015-12-29 11:58                   ` Chris Wilson
2016-01-05 10:16                     ` Daniel Vetter
2016-01-05 10:32                       ` Daniel Vetter
2015-12-29  8:19                 ` [PATCH 1/2] drm/i915: Unbind objects in shrinker only if device is runtime active kbuild test robot
2016-03-29  4:50                 ` [PATCH v2 " Praveen Paneri
  -- strict thread matches above, loose matches on Subject: below --
2016-03-30 10:11 [PATCH] " Mika Kuoppala
2016-03-30 10:20 ` Chris Wilson
2016-03-30 10:32   ` Mika Kuoppala

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=567C0466.60506@intel.com \
    --to=akash.goel@intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=praveen.paneri@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox