diff options
author | kaf24@freefall.cl.cam.ac.uk <kaf24@freefall.cl.cam.ac.uk> | 2004-11-03 15:15:32 +0000 |
---|---|---|
committer | kaf24@freefall.cl.cam.ac.uk <kaf24@freefall.cl.cam.ac.uk> | 2004-11-03 15:15:32 +0000 |
commit | 7653ae61d89d9414a9c1835a1c2b08f487a9f3e6 (patch) | |
tree | 4cbe085d09ba6fca425d598d7d14155397fcddea | |
parent | 1707cb78aa6a1853a87e3729903c2c8e92a7fc01 (diff) | |
download | xen-7653ae61d89d9414a9c1835a1c2b08f487a9f3e6.tar.gz xen-7653ae61d89d9414a9c1835a1c2b08f487a9f3e6.tar.bz2 xen-7653ae61d89d9414a9c1835a1c2b08f487a9f3e6.zip |
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.
-rw-r--r-- | xen/arch/x86/domain.c | 20 | ||||
-rw-r--r-- | xen/common/page_alloc.c | 11 | ||||
-rw-r--r-- | xen/include/asm-x86/apic.h | 3 |
3 files changed, 32 insertions, 2 deletions
diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c index 784027fc11..84ce4afce9 100644 --- a/xen/arch/x86/domain.c +++ b/xen/arch/x86/domain.c @@ -699,7 +699,25 @@ int construct_dom0(struct domain *p, } /* Paranoia: scrub DOM0's memory allocation. */ - memset((void *)alloc_start, 0, alloc_end - alloc_start); + printk("Scrubbing DOM0 RAM: "); + dst = (char *)alloc_start; + while ( dst < (char *)alloc_end ) + { +#define SCRUB_BYTES (100 * 1024 * 1024) /* 100MB */ + printk("."); + touch_nmi_watchdog(); + if ( ((char *)alloc_end - dst) > SCRUB_BYTES ) + { + memset(dst, 0, SCRUB_BYTES); + dst += SCRUB_BYTES; + } + else + { + memset(dst, 0, (char *)alloc_end - dst); + break; + } + } + printk("done.\n"); /* Construct a frame-allocation list for the initial domain. */ for ( mfn = (alloc_start>>PAGE_SHIFT); diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c index ccb7733846..c8c96dbee3 100644 --- a/xen/common/page_alloc.c +++ b/xen/common/page_alloc.c @@ -293,8 +293,17 @@ void scrub_heap_pages(void) void *p; unsigned long pfn, flags; + printk("Scrubbing Free RAM: "); + for ( pfn = 0; pfn < (bitmap_size * 8); pfn++ ) { + /* Every 100MB, print a progress dot and appease the watchdog. */ + if ( (pfn % ((100*1024*1024)/PAGE_SIZE)) == 0 ) + { + printk("."); + touch_nmi_watchdog(); + } + /* Quick lock-free check. */ if ( allocated_in_map(pfn) ) continue; @@ -311,6 +320,8 @@ void scrub_heap_pages(void) spin_unlock_irqrestore(&heap_lock, flags); } + + printk("done.\n"); } diff --git a/xen/include/asm-x86/apic.h b/xen/include/asm-x86/apic.h index 2c533fe0b2..54289910ab 100644 --- a/xen/include/asm-x86/apic.h +++ b/xen/include/asm-x86/apic.h @@ -77,7 +77,8 @@ extern void init_apic_mappings (void); extern void smp_local_timer_interrupt (struct xen_regs * regs); extern void setup_APIC_clocks (void); extern void setup_apic_nmi_watchdog (void); -extern inline void nmi_watchdog_tick (struct xen_regs * regs); +extern void nmi_watchdog_tick (struct xen_regs * regs); +extern void touch_nmi_watchdog(void); extern int APIC_init_uniprocessor (void); extern void disable_APIC_timer(void); extern void enable_APIC_timer(void); |