]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915/gem: Avoid implicit vmap for highmem on x86-32
authorChris Wilson <chris@chris-wilson.co.uk>
Tue, 15 Sep 2020 09:14:15 +0000 (10:14 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Tue, 15 Sep 2020 10:33:36 +0000 (11:33 +0100)
commit8a4b1d1dd02a8458088904f89946ef50cf59fc6a
tree90397b227cd6595f5c98da7bf1b1b5b54eae92b5
parent682e7bf552dd1d19b3ceffc9f6de307f2c03a70e
drm/i915/gem: Avoid implicit vmap for highmem on x86-32

On 32b, highmem using a finite set of indirect PTE (i.e. vmap) to provide
virtual mappings of the high pages.  As these are finite, map_new_virtual()
must wait for some other kmap() to finish when it runs out. If we map a
large number of objects, there is no method for it to tell us to release
the mappings, and we deadlock.

However, if we make an explicit vmap of the page, that uses a larger
vmalloc arena, and also has the ability to tell us to release unwanted
mappings. Most importantly, it will fail and propagate an error instead
of waiting forever.

Fixes: 35e9edaa0fa3 ("drm/i915: Avoid allocating a vmap arena for a single page") #x86-32
References: 52ea4355bd8d ("drm/i915/shrinker: Hook up vmap allocation failure notifier")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Cc: <stable@vger.kernel.org> # v4.7+
Link: https://patchwork.freedesktop.org/patch/msgid/20200915091417.4086-1-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/gem/i915_gem_pages.c