ia64/xen-unstable

changeset 9006:8ee4d4dac552

[IA64] Found the lost memory

This patch can work around virtual memmap/discontig memory issues,
but memory gain may not be realized.

Signed-off-by: Anthony Xu <anthony.xu@intel.com>
author awilliam@xenbuild.aw
date Tue Feb 28 12:02:50 2006 -0700 (2006-02-28)
parents 0b0be946cf9c
children f4b83d04643c
files xen/arch/ia64/xen/xensetup.c
line diff
     1.1 --- a/xen/arch/ia64/xen/xensetup.c	Tue Feb 28 10:29:30 2006 -0700
     1.2 +++ b/xen/arch/ia64/xen/xensetup.c	Tue Feb 28 12:02:50 2006 -0700
     1.3 @@ -155,6 +155,24 @@ struct ns16550_defaults ns16550_com2 = {
     1.4      .parity    = 'n',
     1.5      .stop_bits = 1
     1.6  };
     1.7 +/*  This is a wrapper function of init_domheap_pages,
     1.8 + *  memory exceeds (max_page<<PAGE_SHIFT) will not be reclaimed.
     1.9 + *  This function will go away when the virtual memmap/discontig
    1.10 + *  memory issues are solved
    1.11 + */
    1.12 +void init_domheap_pages_wrapper(unsigned long ps, unsigned long pe)
    1.13 +{
    1.14 +    unsigned long s_nrm, e_nrm, max_mem;
    1.15 +    max_mem = (max_page+1)<<PAGE_SHIFT;
    1.16 +    s_nrm = (ps+PAGE_SIZE-1)&PAGE_MASK;
    1.17 +    e_nrm = pe&PAGE_MASK;
    1.18 +    s_nrm = min(s_nrm, max_mem);
    1.19 +    e_nrm = min(e_nrm, max_mem);
    1.20 +    if(s_nrm < e_nrm)
    1.21 +         init_domheap_pages(s_nrm, e_nrm);
    1.22 +}
    1.23 +
    1.24 +
    1.25  
    1.26  void start_kernel(void)
    1.27  {
    1.28 @@ -376,12 +394,14 @@ printk("About to call domain_create()\n"
    1.29      dom0->vcpu[0]->cpu_affinity = cpumask_of_cpu(0);
    1.30  
    1.31      /* The stash space for the initial kernel image can now be freed up. */
    1.32 -    init_domheap_pages(ia64_boot_param->domain_start,
    1.33 -                       ia64_boot_param->domain_size);
    1.34 +    /* init_domheap_pages_wrapper is temporary solution, please refer to the
    1.35 +     * descriptor of this function */
    1.36 +    init_domheap_pages_wrapper(ia64_boot_param->domain_start,
    1.37 +           ia64_boot_param->domain_start+ia64_boot_param->domain_size);
    1.38      /* throw away initrd area passed from elilo */
    1.39      if (ia64_boot_param->initrd_size) {
    1.40 -        init_domheap_pages(ia64_boot_param->initrd_start,
    1.41 -                          ia64_boot_param->initrd_size);
    1.42 +        init_domheap_pages_wrapper(ia64_boot_param->initrd_start,
    1.43 +           ia64_boot_param->initrd_start+ia64_boot_param->initrd_size);
    1.44      }
    1.45  
    1.46      if (!running_on_sim)  // slow on ski and pages are pre-initialized to zero