]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915: Implement an oom-notifier for last resort shrinking
authorChris Wilson <chris@chris-wilson.co.uk>
Tue, 20 May 2014 07:28:43 +0000 (08:28 +0100)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Tue, 20 May 2014 08:57:13 +0000 (10:57 +0200)
commit5ac19aad8943bd26450d1cf163d89ae2955ce1dd
tree9e8b8903fdaae1f10c20246c8cce2c7caa606110
parente2b1a3ae9bc750791f5911ba9594ce35be092025
drm/i915: Implement an oom-notifier for last resort shrinking

Before the process killer is invoked, oom-notifiers are executed for one
last try at recovering pages. We can hook into this callback to be sure
that everything that can be is purged from our page lists, and to give a
summary of how much memory is still pinned by the GPU in the case of an
oom. This should be really valuable for debugging OOM issues.

Note that the last-ditch effort call to shrink_all we've previously
called from our normal shrinker when we could free as much as the vm
demaned is moved into the oom notifier. Since the shrinker accounting
races against bind/unbind operations we might have called shrink_all
prematurely, which this approach with an oom notifier avoids.

References: https://bugs.freedesktop.org/show_bug.cgi?id=72742
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Tested-by: lu hua <huax.lu@intel.com>
[danvet: Bikeshed logical | into || and pimp commit message.]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/i915_drv.h
drivers/gpu/drm/i915/i915_gem.c