From: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v2] drm/i915: Idle the GPU before shinking everything
Date: Wed, 08 Nov 2017 16:56:49 +0200 [thread overview]
Message-ID: <1510153009.4626.27.camel@linux.intel.com> (raw)
In-Reply-To: <20171108094400.1386-1-chris@chris-wilson.co.uk>
On Wed, 2017-11-08 at 09:44 +0000, Chris Wilson wrote:
> The handling of contexts are peculiar. Instead of tieing their vma to
> activity, we pin the context. This means that we cannot simply unbind
> the context object itself at will (which would normally cause us to wait
> for the vma to be idle), but must manually idle the GPU and retire
> requests first.
>
> A consequence of this peculiarity is when doing a last desperate attempt
> to recover memory. If the memory is tied up inside active context
> objects, we will fail to recover any memory simply by trying to unbind
> the objects without first doing a wait-for-idle.
>
> A side-effect of removing the call to shrinker_lock_uninterruptible()
> from i915_gem_shrinker_oom() was that we removed an unlocked
> wait-for-idle, and so lost the "natural" shrinkage of context objects.
> By replacing that with a locked wait from inside i915_gem_shrink(), we
> not only replace it with the ability to recover all context objects, but
> do so for all i915_gem_shrink_all() callers.
>
> v2: Switching requires request allocation, which is not permitted from
> inside the shrinker as it only uses ordinary allocations.
>
> References: https://bugs.freedesktop.org/show_bug.cgi?id=102936
> Fixes: f2123818ffad ("drm/i915: Move dev_priv->mm.[un]bound_list to its own lock")
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
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-11-08 14:56 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-07 21:31 [PATCH] drm/i915: Idle the GPU before shinking everything Chris Wilson
2017-11-08 9:31 ` ✗ Fi.CI.BAT: failure for " Patchwork
2017-11-08 9:38 ` [PATCH] " Chris Wilson
2017-11-08 9:44 ` [PATCH v2] " Chris Wilson
2017-11-08 14:56 ` Joonas Lahtinen [this message]
2017-11-08 10:59 ` ✓ Fi.CI.BAT: success for drm/i915: Idle the GPU before shinking everything (rev2) Patchwork
2017-11-08 11:37 ` ✗ Fi.CI.BAT: failure " Patchwork
2017-11-08 11:57 ` ✓ Fi.CI.BAT: success " Patchwork
2017-11-08 13:06 ` ✓ Fi.CI.IGT: " Patchwork
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=1510153009.4626.27.camel@linux.intel.com \
--to=joonas.lahtinen@linux.intel.com \
--cc=chris@chris-wilson.co.uk \
--cc=intel-gfx@lists.freedesktop.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