Skip to contentSkip to conversation

set default values for the low_mem_emergency_pool

PATCH New Ky Srinivasan 1 participant 2 messages May 18, 2006 – May 19, 2006 3 messages not in the archive x86

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

#3 lore raw

PATCH 1/1 set default values for the low_mem_emergency_pool

Attached is a trivial patch for setting the default value of the low_mem_emergency_pool. The pool is sized based on the available physical memory on the machine.

Signed-off-by K. Y. Srinivasan <[email protected]>

arch/x86/x86_32/mm.c +14 -0
diff -Nur xen/arch/x86/x86_32/mm.c new-xen/arch/x86/x86_32/mm.c
@@ -62,6 +62,8 @@
     return &idle_pg_table_l2[l2_linear_offset(v)];
 }
 
+extern unsigned long lowmem_emergency_pool_pages;
+
 void __init paging_init(void)
 {
     void *ioremap_pt;
@@ -126,6 +128,18 @@
             l2e_from_page(virt_to_page(idle_vcpu[0]->domain->
                                        arch.mm_perdomain_pt) + i,
                           __PAGE_HYPERVISOR);
+    
+    /* 
+     * Size the lowmem_emergency_pool based on the total memory on the box 
+     * This pool is needed only on 32 bit PAE configurations (4g to 16g).
+     */ 
+    if (lowmem_emergency_pool_pages) 
+    	return;
+    if ((total_pages > (1000 * 1000) && (total_pages <= (2000*1000)))) {
+    	lowmem_emergency_pool_pages = 4000;
+    } else if ((total_pages > (2000 * 1000) && (total_pages < (4*1000*1000)))) {
+    	lowmem_emergency_pool_pages = 8000;
+    }
 }
 
 void __init zap_low_mappings(l2_pgentry_t *base)
common/page_alloc.c +1 -1
diff -Nur xen/common/page_alloc.c new-xen/common/page_alloc.c
@@ -47,7 +47,7 @@
  * allocation requests. Ordinary requests will not fall back to the
  * lowmem emergency pool.
  */
-static unsigned long lowmem_emergency_pool_pages;
+unsigned long lowmem_emergency_pool_pages;
 static void parse_lowmem_emergency_pool(char *s)
 {
     unsigned long long bytes;

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#4 lore raw

PATCH 1/1 set default values for the low_mem_emergency_pool

Attached is a trivial patch for setting the default value of the low_mem_emergency_pool. The pool is sized based on the available physical memory on the machine. Please ignore the previous patch that was sent for setting the default value for the lowmem pool.

Please apply this to the 3.0 testing as well.

Signed-off-by K. Y. Srinivasan <[email protected]>

arch/x86/x86_32/mm.c +16 -0
diff -Nur xen/arch/x86/x86_32/mm.c new-xen/arch/x86/x86_32/mm.c
@@ -62,6 +62,8 @@
     return &idle_pg_table_l2[l2_linear_offset(v)];
 }
 
+extern unsigned long lowmem_emergency_pool_pages;
+
 void __init paging_init(void)
 {
     void *ioremap_pt;
@@ -126,6 +128,20 @@
             l2e_from_page(virt_to_page(idle_vcpu[0]->domain->
                                        arch.mm_perdomain_pt) + i,
                           __PAGE_HYPERVISOR);
+    
+    /* 
+     * Size the lowmem_emergency_pool based on the total memory on the box 
+     * This pool is needed only on 32 bit PAE configurations (4g to 16g).
+     */ 
+    if (lowmem_emergency_pool_pages) 
+    	return;
+
+    if (total_pages > (4 * 1024 * 1024))
+	lowmem_emergency_pool_pages = 12000;
+    else if (total_pages > (2 * 1024 * 1024))
+	lowmem_emergency_pool_pages = 8000;
+    else if (total_pages > (1 * 1024 * 1024) || max_page >= (1 * 1024 * 1024))
+	lowmem_emergency_pool_pages = 4000;
 }
 
 void __init zap_low_mappings(l2_pgentry_t *base)
common/page_alloc.c +1 -1
diff -Nur xen/common/page_alloc.c new-xen/common/page_alloc.c
@@ -47,7 +47,7 @@
  * allocation requests. Ordinary requests will not fall back to the
  * lowmem emergency pool.
  */
-static unsigned long lowmem_emergency_pool_pages;
+unsigned long lowmem_emergency_pool_pages;
 static void parse_lowmem_emergency_pool(char *s)
 {
     unsigned long long bytes;

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel