rpms/kernel/F-12 drm-i915-add-reclaimable-to-page-allocations.patch, NONE, 1.1 drm-i915-fix-hibernate-memory-corruption.patch, NONE, 1.1 kernel.spec, 1.2110, 1.2111

Chuck Ebbert cebbert at fedoraproject.org
Sat Jul 24 00:53:23 UTC 2010


Author: cebbert

Update of /cvs/pkgs/rpms/kernel/F-12
In directory cvs01.phx2.fedoraproject.org:/tmp/cvs-serv9416

Modified Files:
	kernel.spec 
Added Files:
	drm-i915-add-reclaimable-to-page-allocations.patch 
	drm-i915-fix-hibernate-memory-corruption.patch 
Log Message:
drm-i915-fix-hibernate-memory-corruption.patch,
  drm-i915-add-reclaimable-to-page-allocations.patch:
  Fixes for hibernation memory corruption bugs introduced in 2.6.32.8

drm-i915-add-reclaimable-to-page-allocations.patch:
 i915_gem.c |    1 +
 1 file changed, 1 insertion(+)

--- NEW FILE drm-i915-add-reclaimable-to-page-allocations.patch ---
From: Linus Torvalds <torvalds at linux-foundation.org>
Date: Sun, 18 Jul 2010 16:44:37 +0000 (-0700)
Subject: drm/i915: add 'reclaimable' to i915 self-reclaimable page allocations
X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=cd9f040df6ce46573760a507cb88192d05d27d86

drm/i915: add 'reclaimable' to i915 self-reclaimable page allocations

The hibernate issues that got fixed in commit 985b823b9192 ("drm/i915:
fix hibernation since i915 self-reclaim fixes") turn out to have been
incomplete.  Vefa Bicakci tested lots of hibernate cycles, and without
the __GFP_RECLAIMABLE flag the system eventually fails to resume.

With the flag added, Vefa can apparently hibernate forever (or until he
gets bored running his automated scripts, whichever comes first).

The reclaimable flag was there originally, and was one of the flags that
were dropped (unintentionally) by commit 4bdadb978569 ("drm/i915:
Selectively enable self-reclaim") that introduced all these problems,
but I didn't want to just blindly add back all the flags in commit
985b823b9192, and it looked like __GFP_RECLAIM wasn't necessary.  It
clearly was.

I still suspect that there is some subtle reason we're missing that
causes the problems, but __GFP_RECLAIMABLE is certainly not wrong to use
in this context, and is what the code historically used.  And we have no
idea what the causes the corruption without it.

Reported-and-tested-by: M. Vefa Bicakci <bicave at superonline.com>
Cc: Dave Airlie <airlied at gmail.com>
Cc: Chris Wilson <chris at chris-wilson.co.uk>
Cc: KOSAKI Motohiro <kosaki.motohiro at jp.fujitsu.com>
Cc: Hugh Dickins <hugh.dickins at tiscali.co.uk>
Cc: stable at kernel.org
Signed-off-by: Linus Torvalds <torvalds at linux-foundation.org>
---

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 0743858..8757ecf 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -2241,6 +2241,7 @@ i915_gem_object_get_pages(struct drm_gem_object *obj,
 		page = read_cache_page_gfp(mapping, i,
 					   GFP_HIGHUSER |
 					   __GFP_COLD |
+					   __GFP_RECLAIMABLE |
 					   gfpmask);
 		if (IS_ERR(page))
 			goto err_pages;

drm-i915-fix-hibernate-memory-corruption.patch:
 i915_gem.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- NEW FILE drm-i915-fix-hibernate-memory-corruption.patch ---
From: Linus Torvalds <torvalds at linux-foundation.org>
Date: Fri, 2 Jul 2010 00:04:42 +0000 (+1000)
Subject: drm/i915: fix hibernation since i915 self-reclaim fixes
X-Git-Tag: v2.6.35-rc4~13
X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=985b823b919273fe1327d56d2196b4f92e5d0fae

drm/i915: fix hibernation since i915 self-reclaim fixes

Since commit 4bdadb9785696439c6e2b3efe34aa76df1149c83 ("drm/i915:
Selectively enable self-reclaim"), we've been passing GFP_MOVABLE to the
i915 page allocator where we weren't before due to some over-eager
removal of the page mapping gfp_flags games the code used to play.

This caused hibernate on Intel hardware to result in a lot of memory
corruptions on resume.  See for example

  http://bugzilla.kernel.org/show_bug.cgi?id=13811

Reported-by: Evengi Golov (in bugzilla)
Signed-off-by: Dave Airlie <airlied at redhat.com>
Tested-by: M. Vefa Bicakci <bicave at superonline.com>
Cc: stable at kernel.org
Cc: Chris Wilson <chris at chris-wilson.co.uk>
Cc: KOSAKI Motohiro <kosaki.motohiro at jp.fujitsu.com>
Cc: Hugh Dickins <hugh.dickins at tiscali.co.uk>
Signed-off-by: Linus Torvalds <torvalds at linux-foundation.org>
---

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 9ded3da..0743858 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -2239,7 +2239,7 @@ i915_gem_object_get_pages(struct drm_gem_object *obj,
 	mapping = inode->i_mapping;
 	for (i = 0; i < page_count; i++) {
 		page = read_cache_page_gfp(mapping, i,
-					   mapping_gfp_mask (mapping) |
+					   GFP_HIGHUSER |
 					   __GFP_COLD |
 					   gfpmask);
 		if (IS_ERR(page))


Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/F-12/kernel.spec,v
retrieving revision 1.2110
retrieving revision 1.2111
diff -u -p -r1.2110 -r1.2111
--- kernel.spec	23 Jul 2010 18:10:50 -0000	1.2110
+++ kernel.spec	24 Jul 2010 00:53:22 -0000	1.2111
@@ -722,7 +722,8 @@ Patch1813: drm-radeon-pm.patch
 Patch1818: drm-i915-resume-force-mode.patch
 Patch1819: drm-intel-big-hammer.patch
 Patch1820: drm-intel-no-tv-hotplug.patch
-#Patch1821: drm-page-flip.patch
+Patch1821: drm-i915-fix-hibernate-memory-corruption.patch
+Patch1822: drm-i915-add-reclaimable-to-page-allocations.patch
 # intel drm is all merged upstream
 Patch1824: drm-intel-next.patch
 Patch1825: drm-intel-acpi-populate-didl.patch
@@ -1458,6 +1459,10 @@ ApplyPatch drm-upgrayedd.patch
 ApplyOptionalPatch drm-intel-next.patch
 ApplyPatch drm-intel-acpi-populate-didl.patch
 ApplyPatch drm-intel-make-lvds-work.patch
+# hibernation memory corruption fixes
+ApplyPatch drm-i915-fix-hibernate-memory-corruption.patch
+ApplyPatch drm-i915-add-reclaimable-to-page-allocations.patch
+
 ApplyPatch drm-nouveau-g80-ctxprog.patch
 ApplyPatch drm-nouveau-tvout-disable.patch
 ApplyPatch drm-nouveau-safetile-getparam.patch
@@ -2209,6 +2214,11 @@ fi
 %kernel_variant_files -k vmlinux %{with_kdump} kdump
 
 %changelog
+* Fri Jul 23 2010 Chuck Ebbert <cebbert at redhat.com>  2.6.32.16-149
+- drm-i915-fix-hibernate-memory-corruption.patch,
+  drm-i915-add-reclaimable-to-page-allocations.patch:
+  Fixes for hibernation memory corruption bugs introduced in 2.6.32.8
+
 * Fri Jul 23 2010 Chuck Ebbert <cebbert at redhat.com>  2.6.32.16-148
 - ext4-make-sure-the-move_ext-ioctl-can-t-overwrite-append-only-files.patch
   (CVE-2010-2066)



More information about the scm-commits mailing list