Skip to content

Commit 505a8ec

Browse files
ickletorvalds
authored andcommitted
Revert "drm/i915/userptr: Acquire the page lock around set_page_dirty()"
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]>
1 parent 98dcb38 commit 505a8ec

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

drivers/gpu/drm/i915/gem/i915_gem_userptr.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -664,15 +664,7 @@ i915_gem_userptr_put_pages(struct drm_i915_gem_object *obj,
664664

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

677669
mark_page_accessed(page);
678670
put_page(page);

0 commit comments

Comments
 (0)