]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
x86: add periodic corruption check
authorHugh Dickins <hugh@veritas.com>
Sun, 7 Sep 2008 08:51:33 +0000 (01:51 -0700)
committerIngo Molnar <mingo@elte.hu>
Sun, 7 Sep 2008 15:40:00 +0000 (17:40 +0200)
Perodically check for corruption in low phusical memory.  Don't bother
checking at fault time, since it won't show anything useful.

Signed-off-by: Hugh Dickins <hugh@veritas.com>
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
arch/x86/kernel/setup.c
arch/x86/mm/fault.c
arch/x86/mm/init_32.c
arch/x86/mm/init_64.c
include/linux/kernel.h

index ee89ebc5aabc7679e46bff29db43e062176c0a26..c239b378097395d3270eab23d64a08b92474375f 100644 (file)
@@ -623,6 +623,7 @@ static void __init setup_bios_corruption_check(void)
 }
 
 static int __read_mostly bios_corruption_check = 1;
+static struct timer_list periodic_check_timer;
 
 void check_for_bios_corruption(void)
 {
@@ -650,6 +651,22 @@ void check_for_bios_corruption(void)
                dump_stack();
 }
 
+static void periodic_check_for_corruption(unsigned long data)
+{
+       check_for_bios_corruption();
+       mod_timer(&periodic_check_timer, jiffies + 60*HZ);
+}
+
+void start_periodic_check_for_corruption(void)
+{
+       if (!bios_corruption_check)
+               return;
+
+       init_timer(&periodic_check_timer);
+       periodic_check_timer.function = &periodic_check_for_corruption;
+       periodic_check_for_corruption(0);
+}
+
 static int set_bios_corruption_check(char *arg)
 {
        char *end;
index 5140bdf03020d7311ffe8e03cd069b1e4125577a..455f3fe67b42412c8acda3eb63e33678ebec1845 100644 (file)
@@ -848,8 +848,6 @@ no_context:
  * Oops. The kernel tried to access some bad page. We'll have to
  * terminate things with extreme prejudice.
  */
-       check_for_bios_corruption();
-
 #ifdef CONFIG_X86_32
        bust_spinlocks(1);
 #else
index d37f29376b0ce455ae3907051a58779f4b995a25..657a16ad61bad446e7a7f8939d47b9c881727256 100644 (file)
@@ -907,6 +907,8 @@ void __init mem_init(void)
        int codesize, reservedpages, datasize, initsize;
        int tmp;
 
+       start_periodic_check_for_corruption();
+
 #ifdef CONFIG_FLATMEM
        BUG_ON(!mem_map);
 #endif
index d3746efb060d1602a9de63d3be955522f0cd2a5d..f4db5276fa21e91a8e20a009166598b7866c92d2 100644 (file)
@@ -769,6 +769,8 @@ void __init mem_init(void)
 {
        long codesize, reservedpages, datasize, initsize;
 
+       start_periodic_check_for_corruption();
+
        pci_iommu_alloc();
 
        /* clear_bss() already clear the empty_zero_page */
index 8017129e6b631eb67779cb5dec0c9b2b54a5a4ae..00bb251c64514847b101de2bb52a118b91f28304 100644 (file)
@@ -246,6 +246,7 @@ extern int root_mountflags;
  * able to scatter it around anywhere in the kernel.
  */
 void check_for_bios_corruption(void);
+void start_periodic_check_for_corruption(void);
 #else
 static inline void check_for_bios_corruption(void)
 {