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);
|