mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
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.
This commit is contained in:
1 parent
1707cb78aa
commit
7653ae61d8
3 files changed
+32
-2
No files matched your search
+19
-1
@@ -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);
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||