]> bbs.cooldavid.org Git - net-next-2.6.git/commit
drm/i915: Improve behaviour under memory pressure
authorChris Wilson <chris@chris-wilson.co.uk>
Mon, 14 Sep 2009 15:50:30 +0000 (16:50 +0100)
committerJesse Barnes <jbarnes@virtuousgeek.org>
Thu, 17 Sep 2009 21:43:32 +0000 (14:43 -0700)
commit07f73f6912667621276b002e33844ef283d98203
tree4da6860e7d4a165ef1fe233becc74005f9964ca2
parent3ef94daae7530b4ebcd2e5f48f1028cd2d2470ba
drm/i915: Improve behaviour under memory pressure

Due to the necessity of having to take the struct_mutex, the i915
shrinker can not free the inactive lists if we fail to allocate memory
whilst processing a batch buffer, triggering an OOM and an ENOMEM that
is reported back to userspace. In order to fare better under such
circumstances we need to manually retry a failed allocation after
evicting inactive buffers.

To do so involves 3 steps:
1. Marking the backing shm pages as NORETRY.
2. Updating the get_pages() callers to evict something on failure and then
   retry.
3. Revamping the evict something logic to be smarter about the required
   buffer size and prefer to use volatile or clean inactive pages.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
drivers/gpu/drm/drm_gem.c
drivers/gpu/drm/i915/i915_gem.c