diff options
author | kaf24@viper.(none) <kaf24@viper.(none)> | 2005-02-26 18:18:12 +0000 |
---|---|---|
committer | kaf24@viper.(none) <kaf24@viper.(none)> | 2005-02-26 18:18:12 +0000 |
commit | 36222d3c275b8a938112ae75e9dc3e4337e686f8 (patch) | |
tree | f87cb009f09004c91689f1a2b839c76083712c94 | |
parent | 0aeef37025910a47ba71852c59efe1fbc70f06bf (diff) | |
download | xen-36222d3c275b8a938112ae75e9dc3e4337e686f8.tar.gz xen-36222d3c275b8a938112ae75e9dc3e4337e686f8.tar.bz2 xen-36222d3c275b8a938112ae75e9dc3e4337e686f8.zip |
bitkeeper revision 1.1159.258.14 (4220bd64Y3CN44gbDCh9mtv5s9QiDA)
Fix ballooning where initial allocation is lower than max possible lowmem.
Signed-off-by: Keir Fraser <keir@xensource.com>
-rw-r--r-- | linux-2.4.29-xen-sparse/arch/xen/mm/init.c | 6 | ||||
-rw-r--r-- | linux-2.6.10-xen-sparse/arch/xen/i386/mm/init.c | 13 | ||||
-rw-r--r-- | xen/arch/x86/domain.c | 3 |
3 files changed, 19 insertions, 3 deletions
diff --git a/linux-2.4.29-xen-sparse/arch/xen/mm/init.c b/linux-2.4.29-xen-sparse/arch/xen/mm/init.c index c68e655a06..a2363d0cce 100644 --- a/linux-2.4.29-xen-sparse/arch/xen/mm/init.c +++ b/linux-2.4.29-xen-sparse/arch/xen/mm/init.c @@ -366,6 +366,12 @@ static int __init free_pages_init(void) /* this will put all low memory onto the freelists */ totalram_pages += free_all_bootmem(); + /* XEN: init and count low-mem pages outside initial allocation. */ + for (pfn = boot_pfn; pfn < max_low_pfn; pfn++) { + ClearPageReserved(&mem_map[pfn]); + atomic_set(&mem_map[pfn].count, 1); + totalram_pages++; + } reservedpages = 0; for (pfn = 0; pfn < boot_pfn ; pfn++) { diff --git a/linux-2.6.10-xen-sparse/arch/xen/i386/mm/init.c b/linux-2.6.10-xen-sparse/arch/xen/i386/mm/init.c index 70287cf453..78abb78eae 100644 --- a/linux-2.6.10-xen-sparse/arch/xen/i386/mm/init.c +++ b/linux-2.6.10-xen-sparse/arch/xen/i386/mm/init.c @@ -177,8 +177,10 @@ static void __init kernel_physical_mapping_init(pgd_t *pgd_base) pte = one_page_table_init(pmd); pte += pte_ofs; - /* XEN: Only map initial RAM allocation. */ - for (; pte_ofs < PTRS_PER_PTE && pfn < max_ram_pfn; pte++, pfn++, pte_ofs++) { + for (; pte_ofs < PTRS_PER_PTE && pfn < max_low_pfn; pte++, pfn++, pte_ofs++) { + /* XEN: Only map initial RAM allocation. */ + if (pfn >= max_ram_pfn) + break; if (pte_present(*pte)) continue; if (is_kernel_text(address)) @@ -627,6 +629,7 @@ void __init mem_init(void) int codesize, reservedpages, datasize, initsize; int tmp; int bad_ppro; + unsigned long pfn; #ifndef CONFIG_DISCONTIGMEM if (!mem_map) @@ -655,6 +658,12 @@ void __init mem_init(void) /* this will put all low memory onto the freelists */ totalram_pages += __free_all_bootmem(); + /* XEN: init and count low-mem pages outside initial allocation. */ + for (pfn = xen_start_info.nr_pages; pfn < max_low_pfn; pfn++) { + ClearPageReserved(&mem_map[pfn]); + atomic_set(&mem_map[pfn].count, 1); + totalram_pages++; + } reservedpages = 0; for (tmp = 0; tmp < max_low_pfn; tmp++) diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c index e4c427d402..21cfdd9515 100644 --- a/xen/arch/x86/domain.c +++ b/xen/arch/x86/domain.c @@ -764,6 +764,7 @@ int construct_dom0(struct domain *p, printk("done.\n"); /* Construct a frame-allocation list for the initial domain. */ + p->max_pages = ~0U; for ( mfn = (alloc_start>>PAGE_SHIFT); mfn < (alloc_end>>PAGE_SHIFT); mfn++ ) @@ -773,7 +774,7 @@ int construct_dom0(struct domain *p, page->u.inuse.type_info = 0; page->count_info = PGC_allocated | 1; list_add_tail(&page->list, &p->page_list); - p->tot_pages++; p->max_pages++; + p->tot_pages++; } mpt_alloc = (vpt_start - dsi.v_start) + alloc_start; |