]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915: During shrink_all we only need to idle the GPU
authorChris Wilson <chris@chris-wilson.co.uk>
Thu, 1 Oct 2015 11:18:27 +0000 (12:18 +0100)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 7 Oct 2015 14:05:39 +0000 (16:05 +0200)
commit976ca8fe9ba4a8ba9ee1e155f401a60e6e75f57f
tree47e6730c1df0f72457270a513b873174a0258499
parentc2bc9fe96b3118042c80892f1b73fc552db65a28
drm/i915: During shrink_all we only need to idle the GPU

We can forgo an evict-everything here as the shrinker operation itself
will unbind any vma as required. If we explicitly idle the GPU through a
switch to the default context, we not only create a request in an
illegal context (e.g. whilst shrinking during execbuf with a request
already allocated), but switching to the default context will not free
up the memory backing the active contexts - unless in the unlikely
situation that context had already been closed (and just kept arrive by
being the current context). The saving is near zero and the danger real.

To compensate for the loss of the forced retire, add a couple of
retire-requests to i915_gem_shirnk() - this should help free up any
transitive cache from the requests.

Note that the second retire_requests is for the benefit of the
hand-rolled execlist ctx active tracking: We need to manually kick
requests to get those unpinned again. Once that's fixed we can try to
remove this again.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
[danvet: Add summary of why we need a pile of retire_requests.]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/i915_gem_shrinker.c