From: Matthew Auld <matthew.auld@intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org,
"Thomas Hellström" <thomas.hellstrom@linux.intel.com>
Subject: [Intel-gfx] [PATCH 8/9] drm/i915: mark up internal objects with start_cpu_write
Date: Mon, 18 Oct 2021 18:45:07 +0100 [thread overview]
Message-ID: <20211018174508.2137279-8-matthew.auld@intel.com> (raw)
In-Reply-To: <20211018174508.2137279-1-matthew.auld@intel.com>
While the pages can't be swapped out, they can be discarded by the shrinker.
Normally such objects are marked with __I915_MADV_PURGED, which can't be
unset, and therefore requires a new object. For kernel internal objects
this is not true, since the madv hint is reset for our special volatile
objects, such that we can re-acquire new pages, if so desired, without
needing a new object. As a result we should probably be paranoid here
and put the object back into the CPU domain when discarding the pages,
and also correctly set cache_dirty, if required.
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
---
drivers/gpu/drm/i915/gem/i915_gem_internal.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/gpu/drm/i915/gem/i915_gem_internal.c b/drivers/gpu/drm/i915/gem/i915_gem_internal.c
index e5ae9c06510c..a57a6b7013c2 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_internal.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_internal.c
@@ -134,6 +134,8 @@ static void i915_gem_object_put_pages_internal(struct drm_i915_gem_object *obj,
internal_free_pages(pages);
obj->mm.dirty = false;
+
+ __start_cpu_write(obj);
}
static const struct drm_i915_gem_object_ops i915_gem_object_internal_ops = {
--
2.26.3
next prev parent reply other threads:[~2021-10-18 18:06 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-18 17:45 [Intel-gfx] [PATCH 1/9] drm/i915: mark dmabuf objects as ALLOC_USER Matthew Auld
2021-10-18 17:45 ` [Intel-gfx] [PATCH 2/9] drm/i915: mark userptr " Matthew Auld
2021-10-20 14:36 ` Thomas Hellström
2021-10-18 17:45 ` [Intel-gfx] [PATCH 3/9] drm/i915: extract bypass-llc check into helper Matthew Auld
2021-10-20 14:38 ` Thomas Hellström
2021-10-18 17:45 ` [Intel-gfx] [PATCH 4/9] drm/i915/dmabuf: add paranoid flush-on-acquire Matthew Auld
2021-10-20 14:42 ` Thomas Hellström
2021-10-26 13:44 ` Guenter Roeck
2021-10-18 17:45 ` [Intel-gfx] [PATCH 5/9] drm/i915/userptr: " Matthew Auld
2021-10-20 14:52 ` Thomas Hellström
2021-10-18 17:45 ` [Intel-gfx] [PATCH 6/9] drm/i915/shmem: ensure flush during swap-in on non-LLC Matthew Auld
2021-10-20 14:53 ` Thomas Hellström
2021-10-18 17:45 ` [Intel-gfx] [PATCH 7/9] drm/i915: expand on the kernel-doc for cache_dirty Matthew Auld
2021-10-20 14:58 ` Thomas Hellström
2021-10-18 17:45 ` Matthew Auld [this message]
2021-10-20 15:11 ` [Intel-gfx] [PATCH 8/9] drm/i915: mark up internal objects with start_cpu_write Thomas Hellström
2021-10-18 17:45 ` [Intel-gfx] [PATCH 9/9] drm/i915/selftests: mark up hugepages object " Matthew Auld
2021-10-20 15:12 ` Thomas Hellström
2021-10-18 19:11 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/9] drm/i915: mark dmabuf objects as ALLOC_USER Patchwork
2021-10-18 19:13 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2021-10-18 19:42 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2021-10-19 2:39 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
2021-10-20 14:34 ` [Intel-gfx] [PATCH 1/9] " Thomas Hellström
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=20211018174508.2137279-8-matthew.auld@intel.com \
--to=matthew.auld@intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=thomas.hellstrom@linux.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