Re: [Xen-ia64-devel] [Patch] allocate all memory to dom0
On Thu, 2007-01-18 at 13:06 +0900, Akio Takebe wrote: Hi, If we don't specify dom0_mem, we can use all memory on dom0 with this patch. I change alloc_dom0() to alloc_dom0_size(), and alloc_dom0_size() is static function. Hi Akio, I don't think we're able to do this yet. One of my test systems is an rx6600 w/ 96G of memory. With this patch, I get a _very_ long pause during Xen boot (30 seconds), followed by an endless loop of page allocation failures: (XEN) Domain0 EFI passthrough: ACPI 2.0=0x3fdce000 SMBIOS=0x3e52a000 [long pause here] (XEN) Cannot handle page request order 0! (XEN) Cannot handle page request order 0! (XEN) Cannot handle page request order 0! (XEN) Cannot handle page request order 0! (XEN) Cannot handle page request order 0! ... The most memory I can specify for dom0_mem and still boot seems to be around 87G. Obviously failing to boot is bad, but the long pause while we're individually mapping every page for dom0 is also a usability issue. We either need to see about optimizing this code segment to reduce the delay to something acceptable, or add some kind of forward progress indicator. Thanks, Alex -- Alex Williamson HP Open Source Linux Org. ___ Xen-ia64-devel mailing list Xen-ia64-devel@lists.xensource.com http://lists.xensource.com/xen-ia64-devel
Re: [Xen-ia64-devel] [Patch] allocate all memory to dom0
Hi, Alex Thank you for your comments. I agree, my patch can be applied after fixing .config(of discontigous issue), fixing and optimizing them, and so on. Also, as Mark said, xen-ia64 may not need to allocate all memory and cpu to dom0. IA64 machine is very large system, and dom0 don't need large machine environment. Best Regards, Akio Takebe On Thu, 2007-01-18 at 13:06 +0900, Akio Takebe wrote: Hi, If we don't specify dom0_mem, we can use all memory on dom0 with this patch. I change alloc_dom0() to alloc_dom0_size(), and alloc_dom0_size() is static function. Hi Akio, I don't think we're able to do this yet. One of my test systems is an rx6600 w/ 96G of memory. With this patch, I get a _very_ long pause during Xen boot (30 seconds), followed by an endless loop of page allocation failures: (XEN) Domain0 EFI passthrough: ACPI 2.0=0x3fdce000 SMBIOS=0x3e52a000 [long pause here] (XEN) Cannot handle page request order 0! (XEN) Cannot handle page request order 0! (XEN) Cannot handle page request order 0! (XEN) Cannot handle page request order 0! (XEN) Cannot handle page request order 0! ... The most memory I can specify for dom0_mem and still boot seems to be around 87G. Obviously failing to boot is bad, but the long pause while we're individually mapping every page for dom0 is also a usability issue. We either need to see about optimizing this code segment to reduce the delay to something acceptable, or add some kind of forward progress indicator. Thanks, Alex -- Alex Williamson HP Open Source Linux Org. ___ Xen-ia64-devel mailing list Xen-ia64-devel@lists.xensource.com http://lists.xensource.com/xen-ia64-devel
[Xen-ia64-devel] [Patch] allocate all memory to dom0
Hi, If we don't specify dom0_mem, we can use all memory on dom0 with this patch. I change alloc_dom0() to alloc_dom0_size(), and alloc_dom0_size() is static function. # HG changeset patch # User [EMAIL PROTECTED] # Node ID 1625e2ba02fcb2c7d162e178a045b7d540a213f1 # Parent a2b2b2a011f1d406d49caba478020f3b2b173cb8 allocate all memory to dom0, if we don't specify dom0_mem. Signed-off-by: Akio Takebe [EMAIL PROTECTED] diff -r a2b2b2a011f1 -r 1625e2ba02fc xen/arch/ia64/xen/domain.c --- a/xen/arch/ia64/xen/domain.cMon Jan 15 15:15:26 2007 -0700 +++ b/xen/arch/ia64/xen/domain.cThu Jan 18 13:45:00 2007 +0900 @@ -50,7 +50,7 @@ #include asm/tlb_track.h #include asm/perfmon.h -unsigned long dom0_size = 512*1024*1024; +unsigned long dom0_size = 0; /* dom0_max_vcpus: maximum number of VCPUs to create for dom0. */ static unsigned int dom0_max_vcpus = 1; @@ -936,16 +936,24 @@ static void loaddomainelfimage(struct do } } -void alloc_dom0(void) -{ +static void alloc_dom0_size(void) +{ + unsigned long max_dom0_pages; + + if ( dom0_size == 0 ) + { + max_dom0_pages = avail_domheap_pages() - min(avail_domheap_pages() / 16UL, 512UL (20 - PAGE_SHIFT)) ; + dom0_size = max_dom0_pages * PAGE_SIZE; + } + + if (running_on_sim) { + dom0_size = 128*1024*1024; //FIXME: Should be configurable + } + /* Check dom0 size. */ if (dom0_size 4 * 1024 * 1024) { panic(dom0_mem is too small, boot aborted (try e.g. dom0_mem=256M or dom0_mem=65536K)\n); - } - - if (running_on_sim) { - dom0_size = 128*1024*1024; //FIXME: Should be configurable } /* no need to allocate pages for now @@ -1008,6 +1016,8 @@ int construct_dom0(struct domain *d, memset(dsi, 0, sizeof(struct domain_setup_info)); printk(*** LOADING DOMAIN 0 ***\n); + + alloc_dom0_size(); max_pages = dom0_size / PAGE_SIZE; d-max_pages = max_pages; diff -r a2b2b2a011f1 -r 1625e2ba02fc xen/arch/ia64/xen/xensetup.c --- a/xen/arch/ia64/xen/xensetup.c Mon Jan 15 15:15:26 2007 -0700 +++ b/xen/arch/ia64/xen/xensetup.c Thu Jan 18 13:45:00 2007 +0900 @@ -43,7 +43,6 @@ extern void early_setup_arch(char **); extern void early_setup_arch(char **); extern void late_setup_arch(char **); extern void hpsim_serial_init(void); -extern void alloc_dom0(void); extern void setup_per_cpu_areas(void); extern void mem_init(void); extern void init_IRQ(void); @@ -409,8 +408,6 @@ void start_kernel(void) trap_init(); -alloc_dom0(); - end_boot_allocator(); init_xenheap_pages(__pa(xen_heap_start), xenheap_phys_end); Best Regards, Akio Takebe allocate_all_mem.patch Description: Binary data ___ Xen-ia64-devel mailing list Xen-ia64-devel@lists.xensource.com http://lists.xensource.com/xen-ia64-devel
Re: [Xen-ia64-devel] [Patch] allocate all memory to dom0
Hi, If we don't specify dom0_mem, we can use all memory on dom0 with this patch. I change alloc_dom0() to alloc_dom0_size(), and alloc_dom0_size() is static function. On x86, we've found that if dom0 is initially started with all the memory in the machine allocated to it (and then automatically ballooned down as domains are created) it's possible for Linux to get a bit confused. Ballooning down dom0 lots makes the kernel think there's some sort of memory crunch, when in actual fact there isn't. We find the best configuration is to explicitly set dom0_mem where possible, although it's nice to have it use all the memory as a sensible default. Just thought I'd mention this issue, although I do think it's a good idea to default to giving dom0 all of the available memory in the absence of other directives. Cheers, Mark # HG changeset patch # User [EMAIL PROTECTED] # Node ID 1625e2ba02fcb2c7d162e178a045b7d540a213f1 # Parent a2b2b2a011f1d406d49caba478020f3b2b173cb8 allocate all memory to dom0, if we don't specify dom0_mem. Signed-off-by: Akio Takebe [EMAIL PROTECTED] diff -r a2b2b2a011f1 -r 1625e2ba02fc xen/arch/ia64/xen/domain.c --- a/xen/arch/ia64/xen/domain.c Mon Jan 15 15:15:26 2007 -0700 +++ b/xen/arch/ia64/xen/domain.c Thu Jan 18 13:45:00 2007 +0900 @@ -50,7 +50,7 @@ #include asm/tlb_track.h #include asm/perfmon.h -unsigned long dom0_size = 512*1024*1024; +unsigned long dom0_size = 0; /* dom0_max_vcpus: maximum number of VCPUs to create for dom0. */ static unsigned int dom0_max_vcpus = 1; @@ -936,16 +936,24 @@ static void loaddomainelfimage(struct do } } -void alloc_dom0(void) -{ +static void alloc_dom0_size(void) +{ + unsigned long max_dom0_pages; + + if ( dom0_size == 0 ) + { + max_dom0_pages = avail_domheap_pages() - min(avail_domheap_pages() / 16UL, 512UL (20 - PAGE_SHIFT)) ; + dom0_size = max_dom0_pages * PAGE_SIZE; + } + + if (running_on_sim) { + dom0_size = 128*1024*1024; //FIXME: Should be configurable + } + /* Check dom0 size. */ if (dom0_size 4 * 1024 * 1024) { panic(dom0_mem is too small, boot aborted (try e.g. dom0_mem=256M or dom0_mem=65536K)\n); - } - - if (running_on_sim) { - dom0_size = 128*1024*1024; //FIXME: Should be configurable } /* no need to allocate pages for now @@ -1008,6 +1016,8 @@ int construct_dom0(struct domain *d, memset(dsi, 0, sizeof(struct domain_setup_info)); printk(*** LOADING DOMAIN 0 ***\n); + + alloc_dom0_size(); max_pages = dom0_size / PAGE_SIZE; d-max_pages = max_pages; diff -r a2b2b2a011f1 -r 1625e2ba02fc xen/arch/ia64/xen/xensetup.c --- a/xen/arch/ia64/xen/xensetup.cMon Jan 15 15:15:26 2007 -0700 +++ b/xen/arch/ia64/xen/xensetup.cThu Jan 18 13:45:00 2007 +0900 @@ -43,7 +43,6 @@ extern void early_setup_arch(char **); extern void early_setup_arch(char **); extern void late_setup_arch(char **); extern void hpsim_serial_init(void); -extern void alloc_dom0(void); extern void setup_per_cpu_areas(void); extern void mem_init(void); extern void init_IRQ(void); @@ -409,8 +408,6 @@ void start_kernel(void) trap_init(); -alloc_dom0(); - end_boot_allocator(); init_xenheap_pages(__pa(xen_heap_start), xenheap_phys_end); Best Regards, Akio Takebe -- Dave: Just a question. What use is a unicyle with no seat? And no pedals! Mark: To answer a question with a question: What use is a skateboard? Dave: Skateboards have wheels. Mark: My wheel has a wheel! ___ Xen-ia64-devel mailing list Xen-ia64-devel@lists.xensource.com http://lists.xensource.com/xen-ia64-devel