drm/i915; Preallocate the lazy request
authorChris Wilson <chris@chris-wilson.co.uk>
Wed, 4 Sep 2013 09:45:52 +0000 (10:45 +0100)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Thu, 5 Sep 2013 10:03:53 +0000 (12:03 +0200)
commit3c0e234c847318304c12f9e7fffac7e1cf3db3ff
tree11f5b83d1a88a9aa1683a28356ac617845862999
parent1823521d2b2fa614e7ad95fdc8a0f59e571f37ce
drm/i915; Preallocate the lazy request

It is possible for us to be forced to perform an allocation for the lazy
request whilst running the shrinker. This allocation may fail, leaving
us unable to reclaim any memory leading to premature OOM. A neat
solution to the problem is to preallocate the request at the same time
as acquiring the seqno for the ring transaction. This means that we can
report ENOMEM prior to touching the rings.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Mika Kuoppala <mika.kuoppala@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/i915_gem.c
drivers/gpu/drm/i915/intel_ringbuffer.c
drivers/gpu/drm/i915/intel_ringbuffer.h