ia64/xen-unstable

changeset 2850:a67d12405a6f

bitkeeper revision 1.1159.152.5 (4188f614JwSKayrQ658vZHW3nobpSQ)

When scrubbing memory during machine boot, inform the user what we are
doing, print progress dots, and stop the NMI watchdog from mauling us.
author kaf24@freefall.cl.cam.ac.uk
date Wed Nov 03 15:15:32 2004 +0000 (2004-11-03)
parents 2feec451cdb7
children 0956f3af9fd3
files xen/arch/x86/domain.c xen/common/page_alloc.c xen/include/asm-x86/apic.h
line diff
     1.1 --- a/xen/arch/x86/domain.c	Wed Nov 03 15:14:32 2004 +0000
     1.2 +++ b/xen/arch/x86/domain.c	Wed Nov 03 15:15:32 2004 +0000
     1.3 @@ -699,7 +699,25 @@ int construct_dom0(struct domain *p,
     1.4      }
     1.5  
     1.6      /* Paranoia: scrub DOM0's memory allocation. */
     1.7 -    memset((void *)alloc_start, 0, alloc_end - alloc_start);
     1.8 +    printk("Scrubbing DOM0 RAM: ");
     1.9 +    dst = (char *)alloc_start;
    1.10 +    while ( dst < (char *)alloc_end )
    1.11 +    {
    1.12 +#define SCRUB_BYTES (100 * 1024 * 1024) /* 100MB */
    1.13 +        printk(".");
    1.14 +        touch_nmi_watchdog();
    1.15 +        if ( ((char *)alloc_end - dst) > SCRUB_BYTES )
    1.16 +        {
    1.17 +            memset(dst, 0, SCRUB_BYTES);
    1.18 +            dst += SCRUB_BYTES;
    1.19 +        }
    1.20 +        else
    1.21 +        {
    1.22 +            memset(dst, 0, (char *)alloc_end - dst);
    1.23 +            break;
    1.24 +        }
    1.25 +    }
    1.26 +    printk("done.\n");
    1.27  
    1.28      /* Construct a frame-allocation list for the initial domain. */
    1.29      for ( mfn = (alloc_start>>PAGE_SHIFT); 
     2.1 --- a/xen/common/page_alloc.c	Wed Nov 03 15:14:32 2004 +0000
     2.2 +++ b/xen/common/page_alloc.c	Wed Nov 03 15:15:32 2004 +0000
     2.3 @@ -293,8 +293,17 @@ void scrub_heap_pages(void)
     2.4      void *p;
     2.5      unsigned long pfn, flags;
     2.6  
     2.7 +    printk("Scrubbing Free RAM: ");
     2.8 +
     2.9      for ( pfn = 0; pfn < (bitmap_size * 8); pfn++ )
    2.10      {
    2.11 +        /* Every 100MB, print a progress dot and appease the watchdog. */
    2.12 +        if ( (pfn % ((100*1024*1024)/PAGE_SIZE)) == 0 )
    2.13 +        {
    2.14 +            printk(".");
    2.15 +            touch_nmi_watchdog();
    2.16 +        }
    2.17 +
    2.18          /* Quick lock-free check. */
    2.19          if ( allocated_in_map(pfn) )
    2.20              continue;
    2.21 @@ -311,6 +320,8 @@ void scrub_heap_pages(void)
    2.22          
    2.23          spin_unlock_irqrestore(&heap_lock, flags);
    2.24      }
    2.25 +
    2.26 +    printk("done.\n");
    2.27  }
    2.28  
    2.29  
     3.1 --- a/xen/include/asm-x86/apic.h	Wed Nov 03 15:14:32 2004 +0000
     3.2 +++ b/xen/include/asm-x86/apic.h	Wed Nov 03 15:15:32 2004 +0000
     3.3 @@ -77,7 +77,8 @@ extern void init_apic_mappings (void);
     3.4  extern void smp_local_timer_interrupt (struct xen_regs * regs);
     3.5  extern void setup_APIC_clocks (void);
     3.6  extern void setup_apic_nmi_watchdog (void);
     3.7 -extern inline void nmi_watchdog_tick (struct xen_regs * regs);
     3.8 +extern void nmi_watchdog_tick (struct xen_regs * regs);
     3.9 +extern void touch_nmi_watchdog(void);
    3.10  extern int APIC_init_uniprocessor (void);
    3.11  extern void disable_APIC_timer(void);
    3.12  extern void enable_APIC_timer(void);