rpms/kernel/F-12 highmem-Fix-debug_kmap_atomic-to-also-handle-KM_IRQ_.patch, NONE, 1.1 highmem-Fix-race-in-debug_kmap_atomic-which-could-ca.patch, NONE, 1.1 kernel.spec, 1.1905, 1.1906

Kyle McMartin kyle at fedoraproject.org
Thu Nov 5 03:22:34 UTC 2009


Author: kyle

Update of /cvs/pkgs/rpms/kernel/F-12
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv20984

Modified Files:
	kernel.spec 
Added Files:
	highmem-Fix-debug_kmap_atomic-to-also-handle-KM_IRQ_.patch 
	highmem-Fix-race-in-debug_kmap_atomic-which-could-ca.patch 
Log Message:
* Thu Nov 05 2009 Kyle McMartin <kyle at redhat.com>
- Add two patches from Soren from mingo/linux-2.6-x86.git to fix
  debug_kmap_atomic prints.


highmem-Fix-debug_kmap_atomic-to-also-handle-KM_IRQ_.patch:
 highmem.c |   14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

--- NEW FILE highmem-Fix-debug_kmap_atomic-to-also-handle-KM_IRQ_.patch ---
>From 2f4e71b45499fb1bac4eaf4e2ce2da800aaee824 Mon Sep 17 00:00:00 2001
From: Soeren Sandmann <sandmann at daimi.au.dk>
Date: Wed, 28 Oct 2009 18:56:35 +0100
Subject: highmem: Fix debug_kmap_atomic() to also handle KM_IRQ_PTE, KM_NMI, and KM_NMI_PTE
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Previously calling debug_kmap_atomic() with these types would
cause spurious warnings.

(triggered by SysProf using perf events)

Signed-off-by: Søren Sandmann Pedersen <sandmann at redhat.com>
Cc: Linus Torvalds <torvalds at linux-foundation.org>
Cc: a.p.zijlstra at chello.nl
Cc: linux-mm at kvack.org
LKML-Reference: <ye8vdhz8krw.fsf at camel23.daimi.au.dk>
Signed-off-by: Ingo Molnar <mingo at elte.hu>
(cherry picked from commit 31b6670df6749831f923b1e22c8301d38a52bb8d)
---
 mm/highmem.c |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/mm/highmem.c b/mm/highmem.c
index 33587de..9c1e627 100644
--- a/mm/highmem.c
+++ b/mm/highmem.c
@@ -432,10 +432,15 @@ void debug_kmap_atomic(enum km_type type)
 		return;
 
 	if (unlikely(in_interrupt())) {
-		if (in_irq()) {
+		if (in_nmi()) {
+			if (type != KM_NMI && type != KM_NMI_PTE) {
+				WARN_ON(1);
+				warn_count--;
+			}
+		} else if (in_irq()) {
 			if (type != KM_IRQ0 && type != KM_IRQ1 &&
 			    type != KM_BIO_SRC_IRQ && type != KM_BIO_DST_IRQ &&
-			    type != KM_BOUNCE_READ) {
+			    type != KM_BOUNCE_READ && type != KM_IRQ_PTE) {
 				WARN_ON(1);
 				warn_count--;
 			}
@@ -452,7 +457,9 @@ void debug_kmap_atomic(enum km_type type)
 	}
 
 	if (type == KM_IRQ0 || type == KM_IRQ1 || type == KM_BOUNCE_READ ||
-			type == KM_BIO_SRC_IRQ || type == KM_BIO_DST_IRQ) {
+			type == KM_BIO_SRC_IRQ || type == KM_BIO_DST_IRQ ||
+			type == KM_IRQ_PTE || type == KM_NMI ||
+			type == KM_NMI_PTE ) {
 		if (!irqs_disabled()) {
 			WARN_ON(1);
 			warn_count--;
-- 
1.6.5.2


highmem-Fix-race-in-debug_kmap_atomic-which-could-ca.patch:
 highmem.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

--- NEW FILE highmem-Fix-race-in-debug_kmap_atomic-which-could-ca.patch ---
>From e056b2a738c3c14077ccc7f488d5687a2eb621d1 Mon Sep 17 00:00:00 2001
From: Soeren Sandmann <sandmann at daimi.au.dk>
Date: Wed, 28 Oct 2009 18:55:36 +0100
Subject: highmem: Fix race in debug_kmap_atomic() which could cause warn_count to underflow
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

debug_kmap_atomic() tries to prevent ever printing more than 10
warnings, but it does so by testing whether an unsigned integer
is equal to 0. However, if the warning is caused by a nested
IRQ, then this counter may underflow and the stream of warnings
will never end.

Fix that by using a signed integer instead.

Signed-off-by: Søren Sandmann Pedersen <sandmann at redhat.com>
Cc: Linus Torvalds <torvalds at linux-foundation.org>
Cc: a.p.zijlstra at chello.nl
Cc: linux-mm at kvack.org
LKML-Reference: <ye8zl7b8ktj.fsf at camel23.daimi.au.dk>
Signed-off-by: Ingo Molnar <mingo at elte.hu>
(cherry picked from commit 493c9e09f2e02770a65dcf8321d27b5c11fd2b77)
---
 mm/highmem.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/mm/highmem.c b/mm/highmem.c
index 25878cc..33587de 100644
--- a/mm/highmem.c
+++ b/mm/highmem.c
@@ -426,9 +426,9 @@ void __init page_address_init(void)
 
 void debug_kmap_atomic(enum km_type type)
 {
-	static unsigned warn_count = 10;
+	static int warn_count = 10;
 
-	if (unlikely(warn_count == 0))
+	if (unlikely(warn_count < 0))
 		return;
 
 	if (unlikely(in_interrupt())) {
-- 
1.6.5.2



Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/F-12/kernel.spec,v
retrieving revision 1.1905
retrieving revision 1.1906
diff -u -p -r1.1905 -r1.1906
--- kernel.spec	4 Nov 2009 23:42:29 -0000	1.1905
+++ kernel.spec	5 Nov 2009 03:22:34 -0000	1.1906
@@ -792,6 +792,9 @@ Patch14454: tg3-04-prevent-tx-bd-corrupt
 Patch14455: tg3-05-assign-flags-to-fixes-in-start_xmit_dma_bug.patch
 Patch14456: tg3-06-fix-5906-transmit-hangs.patch
 
+Patch14460: highmem-Fix-debug_kmap_atomic-to-also-handle-KM_IRQ_.patch
+Patch14461: highmem-Fix-race-in-debug_kmap_atomic-which-could-ca.patch
+
 %endif
 
 BuildRoot: %{_tmppath}/kernel-%{KVERREL}-root
@@ -1486,6 +1489,9 @@ ApplyPatch tg3-04-prevent-tx-bd-corrupti
 ApplyPatch tg3-05-assign-flags-to-fixes-in-start_xmit_dma_bug.patch
 ApplyPatch tg3-06-fix-5906-transmit-hangs.patch
 
+ApplyPatch highmem-Fix-debug_kmap_atomic-to-also-handle-KM_IRQ_.patch
+ApplyPatch highmem-Fix-race-in-debug_kmap_atomic-which-could-ca.patch
+
 # END OF PATCH APPLICATIONS
 
 %endif
@@ -2138,6 +2144,10 @@ fi
 # and build.
 
 %changelog
+* Thu Nov 05 2009 Kyle McMartin <kyle at redhat.com>
+- Add two patches from Soren from mingo/linux-2.6-x86.git to fix
+  debug_kmap_atomic prints.
+
 * Thu Nov 05 2009 Ben Skeggs <bskeggs at redhat.com>
 - nouveau: fix rh#532924
 




More information about the fedora-extras-commits mailing list