Jesse Keating 2f82dda
From: Linus Torvalds <torvalds@linux-foundation.org>
Jesse Keating 2f82dda
Date: Sun, 18 Jul 2010 16:44:37 +0000 (-0700)
Jesse Keating 2f82dda
Subject: drm/i915: add 'reclaimable' to i915 self-reclaimable page allocations
Jesse Keating 2f82dda
X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=cd9f040df6ce46573760a507cb88192d05d27d86
Jesse Keating 2f82dda
Jesse Keating 2f82dda
drm/i915: add 'reclaimable' to i915 self-reclaimable page allocations
Jesse Keating 2f82dda
Jesse Keating 2f82dda
The hibernate issues that got fixed in commit 985b823b9192 ("drm/i915:
Jesse Keating 2f82dda
fix hibernation since i915 self-reclaim fixes") turn out to have been
Jesse Keating 2f82dda
incomplete.  Vefa Bicakci tested lots of hibernate cycles, and without
Jesse Keating 2f82dda
the __GFP_RECLAIMABLE flag the system eventually fails to resume.
Jesse Keating 2f82dda
Jesse Keating 2f82dda
With the flag added, Vefa can apparently hibernate forever (or until he
Jesse Keating 2f82dda
gets bored running his automated scripts, whichever comes first).
Jesse Keating 2f82dda
Jesse Keating 2f82dda
The reclaimable flag was there originally, and was one of the flags that
Jesse Keating 2f82dda
were dropped (unintentionally) by commit 4bdadb978569 ("drm/i915:
Jesse Keating 2f82dda
Selectively enable self-reclaim") that introduced all these problems,
Jesse Keating 2f82dda
but I didn't want to just blindly add back all the flags in commit
Jesse Keating 2f82dda
985b823b9192, and it looked like __GFP_RECLAIM wasn't necessary.  It
Jesse Keating 2f82dda
clearly was.
Jesse Keating 2f82dda
Jesse Keating 2f82dda
I still suspect that there is some subtle reason we're missing that
Jesse Keating 2f82dda
causes the problems, but __GFP_RECLAIMABLE is certainly not wrong to use
Jesse Keating 2f82dda
in this context, and is what the code historically used.  And we have no
Jesse Keating 2f82dda
idea what the causes the corruption without it.
Jesse Keating 2f82dda
Jesse Keating 2f82dda
Reported-and-tested-by: M. Vefa Bicakci <bicave@superonline.com>
Jesse Keating 2f82dda
Cc: Dave Airlie <airlied@gmail.com>
Jesse Keating 2f82dda
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Jesse Keating 2f82dda
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Jesse Keating 2f82dda
Cc: Hugh Dickins <hugh.dickins@tiscali.co.uk>
Jesse Keating 2f82dda
Cc: stable@kernel.org
Jesse Keating 2f82dda
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Jesse Keating 2f82dda
---
Jesse Keating 2f82dda
Jesse Keating 2f82dda
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
Jesse Keating 2f82dda
index 0743858..8757ecf 100644
Jesse Keating 2f82dda
--- a/drivers/gpu/drm/i915/i915_gem.c
Jesse Keating 2f82dda
+++ b/drivers/gpu/drm/i915/i915_gem.c
Jesse Keating 2f82dda
@@ -2241,6 +2241,7 @@ i915_gem_object_get_pages(struct drm_gem_object *obj,
Jesse Keating 2f82dda
 		page = read_cache_page_gfp(mapping, i,
Jesse Keating 2f82dda
 					   GFP_HIGHUSER |
Jesse Keating 2f82dda
 					   __GFP_COLD |
Jesse Keating 2f82dda
+					   __GFP_RECLAIMABLE |
Jesse Keating 2f82dda
 					   gfpmask);
Jesse Keating 2f82dda
 		if (IS_ERR(page))
Jesse Keating 2f82dda
 			goto err_pages;