Skip to content

Commit

Permalink
Revert "drm/i915/userptr: Acquire the page lock around set_page_dirty()"
Browse files Browse the repository at this point in the history
The userptr put_pages can be called from inside try_to_unmap, and so
enters with the page lock held on one of the object's backing pages. We
cannot take the page lock ourselves for fear of recursion.

Reported-by: Lionel Landwerlin <[email protected]>
Reported-by: Martin Wilck <[email protected]>
Reported-by: Leo Kraav <[email protected]>
Fixes: aa56a29 ("drm/i915/userptr: Acquire the page lock around set_page_dirty()")
References: https://bugzilla.kernel.org/show_bug.cgi?id=203317
Signed-off-by: Chris Wilson <[email protected]>
Cc: Tvrtko Ursulin <[email protected]>
Cc: Jani Nikula <[email protected]>
Cc: Joonas Lahtinen <[email protected]>
Cc: [email protected]
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
ickle authored and torvalds committed Sep 12, 2019
1 parent 98dcb38 commit 505a8ec
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions drivers/gpu/drm/i915/gem/i915_gem_userptr.c
Original file line number Diff line number Diff line change
Expand Up @@ -664,15 +664,7 @@ i915_gem_userptr_put_pages(struct drm_i915_gem_object *obj,

for_each_sgt_page(page, sgt_iter, pages) {
if (obj->mm.dirty)
/*
* As this may not be anonymous memory (e.g. shmem)
* but exist on a real mapping, we have to lock
* the page in order to dirty it -- holding
* the page reference is not sufficient to
* prevent the inode from being truncated.
* Play safe and take the lock.
*/
set_page_dirty_lock(page);
set_page_dirty(page);

mark_page_accessed(page);
put_page(page);
Expand Down

0 comments on commit 505a8ec

Please sign in to comment.