lkcd
[Top] [All Lists]

[PATCH] LKCD causes BUG in highmem.h when dumping to a large memory syst

To: <lkcd@xxxxxxxxxxx>
Subject: [PATCH] LKCD causes BUG in highmem.h when dumping to a large memory system with HIGHMEM_DEBUG enabled
From: "Tony Dziedzic" <Tony.Dziedzic@xxxxxxxxxxxx>
Date: Tue, 23 Oct 2001 09:05:53 -0400
Sender: owner-lkcd@xxxxxxxxxxx
Thread-index: AcFbw3HC43Hg4GqeQ4ivhWN5p6jk/w==
Thread-topic: [PATCH] LKCD causes BUG in highmem.h when dumping to a large memory system with HIGHMEM_DEBUG enabled
This patch address a BUG in highmem.h that LKCD triggers when dumping to
a large memory system with HIGHMEM_DEBUG enabled.  The BUG occurs the
second time dump_add_page is called for a high memory page, when
dump_add_page calls kmap_atomic.  If HIGHMEM_DEBUG is enabled
kmap_atomic verifies that the caller has released the temporary mapping
via a call to kunmap_atomic.  Since this hasn't happened, highmem.h
BUGs.

The patch adds a call to kunmap_atomic at the end of dump_add_page.
Note that the patch is not required unless your kernel has HIGHMEM_DEBUG
enabled.  There is a slight performance hit associated with this patch
(due to kunmap_atomic's TLB flush).  Those who object to the performance
hit may choose to enclose the #ifdef CONFIG_HIGHMEM conditional in a
#ifdef HIGHMEM_DEBUG conditional.

FYI,
Tony Dziedzic
Storigen Systems, Inc.

--- lkcd/2.4/drivers/dump/dump_base.c   Tue Oct 16 05:33:38 2001
+++ new-lkcd/2.4/drivers/dump/dump_base.c       Tue Oct 23 08:53:12 2001
@@ -549,6 +549,15 @@
                memcpy((void *)(dump_page_buf + *toffset),
                        (const void *)vaddr, size);
        }
+#ifdef CONFIG_HIGHMEM
+       if (PageHighMem(p)) {
+                       /*
+                        * Since this can be executed from IRQ context,
+                * reentrance on the same CPU must be avoided:
+                        */
+               kunmap_atomic(vaddr, KM_BOUNCE_WRITE);
+       }
+#endif
        *toffset += size;
        dump_header.dh_num_pages++;
        return (0);


<Prev in Thread] Current Thread [Next in Thread>