All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH v2 5/5] drm/i915: Revoke any shmemfs mappings on shrinking
Date: Wed, 24 May 2017 15:39:41 +0100	[thread overview]
Message-ID: <20170524143941.10989-5-chris@chris-wilson.co.uk> (raw)
In-Reply-To: <20170524143941.10989-1-chris@chris-wilson.co.uk>

When trying to shrink our buffers, also revoke any existing mappings
(forcing them to be faulted again on reuse) to improve the likelihood of
us being able to pageout the buffer.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/i915_gem.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 7d400d882283..a9388a5eef31 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -2212,8 +2212,9 @@ void __i915_gem_object_invalidate(struct drm_i915_gem_object *obj)
 	if (obj->base.filp == NULL)
 		return;
 
-	mapping = obj->base.filp->f_mapping,
+	mapping = obj->base.filp->f_mapping;
 	invalidate_mapping_pages(mapping, 0, (loff_t)-1);
+	unmap_mapping_range(mapping, 0, (loff_t)-1, 0);
 }
 
 static void
-- 
2.11.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2017-05-24 14:39 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-24 14:39 [PATCH v2 1/5] drm/i915: Wait for struct_mutex inside shrinker Chris Wilson
2017-05-24 14:39 ` [PATCH v2 2/5] drm/i915: Allow kswapd to pause the device whilst reaping Chris Wilson
2017-05-24 14:39 ` [PATCH v2 3/5] drm/i915: Encourage our shrinker more when our shmemfs allocations fails Chris Wilson
2017-05-24 14:39 ` [PATCH v2 4/5] drm/i915: Remove __GFP_NORETRY from our buffer allocator Chris Wilson
2017-05-24 14:39 ` Chris Wilson [this message]
2017-05-24 14:55 ` [PATCH v2 1/5] drm/i915: Wait for struct_mutex inside shrinker Chris Wilson
2017-05-24 15:31   ` Joonas Lahtinen
2017-05-24 15:38     ` Chris Wilson
2017-05-24 14:57 ` ✓ Fi.CI.BAT: success for series starting with [v2,1/5] " Patchwork
2017-05-24 15:08   ` Chris Wilson

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=20170524143941.10989-5-chris@chris-wilson.co.uk \
    --to=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 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.