提交 a1db2fa7 编写于 作者: C Chris Wilson 提交者: Daniel Vetter

drm/i915: Abandon oom quickly if killed by a signal

Whilst waiting to obtain our locks for the last resort shrinking before
an oom, we check whether or not a fatal signal was pending. If there was,
we do not need to keep waiting as the oom will be aborted.
Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
上级 ed57cb8a
...@@ -5194,8 +5194,11 @@ i915_gem_shrinker_oom(struct notifier_block *nb, unsigned long event, void *ptr) ...@@ -5194,8 +5194,11 @@ i915_gem_shrinker_oom(struct notifier_block *nb, unsigned long event, void *ptr)
bool was_interruptible; bool was_interruptible;
bool unlock; bool unlock;
while (!i915_gem_shrinker_lock(dev, &unlock) && --timeout) while (!i915_gem_shrinker_lock(dev, &unlock) && --timeout) {
schedule_timeout_killable(1); schedule_timeout_killable(1);
if (fatal_signal_pending(current))
return NOTIFY_DONE;
}
if (timeout == 0) { if (timeout == 0) {
pr_err("Unable to purge GPU memory due lock contention.\n"); pr_err("Unable to purge GPU memory due lock contention.\n");
return NOTIFY_DONE; return NOTIFY_DONE;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册