]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915: Borrow our struct_mutex for the direct reclaim
authorChris Wilson <chris@chris-wilson.co.uk>
Wed, 21 Nov 2012 13:04:04 +0000 (13:04 +0000)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 21 Nov 2012 16:47:14 +0000 (17:47 +0100)
commitedb09f8996a17ae8c960386fed455f8355496460
tree167ec5514586d474a34f9fa4185fcc56a4034ae1
parent63ccb4c8749044277e1702462a8a0dcefcbc9644
drm/i915: Borrow our struct_mutex for the direct reclaim

If we have hit oom whilst holding our struct_mutex, then currently we
cannot reap our own GPU buffers which likely pin most of memory, making
an outright OOM more likely. So if we are running in direct reclaim and
already hold the mutex, attempt to free buffers knowing that the
original function can not continue until we return.

v2: Add a note explaining that the mutex may be stolen due to
pre-emption, and that is bad.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/i915_gem.c