Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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 <lionel.g.landwerlin@intel.com>
Reported-by: Martin Wilck <Martin.Wilck@suse.com>
Reported-by: Leo Kraav <leho@kraav.com>
Fixes: aa56a292ce62 ("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 <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Jani Nikula <jani.nikula@intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: stable@vger.kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Chris Wilson and committed by
Linus Torvalds
505a8ec7 98dcb386

+1 -9
+1 -9
drivers/gpu/drm/i915/gem/i915_gem_userptr.c
··· 664 664 665 665 for_each_sgt_page(page, sgt_iter, pages) { 666 666 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); 676 668 677 669 mark_page_accessed(page); 678 670 put_page(page);