memory hotplug for ia64 (linux-2.6.7) [1/2]
Subsystems (4)
PATCH 1/1 memory hotplug for ia64 (linux-2.6.7) [1/2]
This is a main patch of memory hotplug for ia64.
arch/ia64/Kconfig +5 -1
@@ -182,10 +182,14 @@ config VIRTUAL_MEM_MAP require the DISCONTIGMEM option for your machine. If you are unsure, say Y. +config MEMHOTPLUG + bool "Memory hotplug test" + default n + config DISCONTIGMEM bool "Discontiguous memory support" depends on (IA64_DIG || IA64_SGI_SN2 || IA64_GENERIC) && NUMA && VIRTUAL_MEM_MAP - default y if (IA64_SGI_SN2 || IA64_GENERIC) && NUMA + default y if (IA64_SGI_SN2 || IA64_GENERIC) && (NUMA || MEMHOTPLUG) help Say Y to support efficient handling of discontiguous physical memory, for architectures which are either NUMA (Non-Uniform Memory Access)
arch/ia64/mm/discontig.c +77 -0
84 lines not on this page · raw message
arch/ia64/mm/init.c +7 -0
@@ -540,8 +540,15 @@ mem_init (void)kclist_add (&kcore_vmem, (void *)VMALLOC_START ,VMALLOC_END -VMALLOC_START );kclist_add (&kcore_kernel, _stext, _end - _stext); +#ifdef CONFIG_MEMHOTPLUG +for_each_pgdat (pgdat){ + pgdat->node_totalram_pages =free_all_bootmem_node (pgdat); + totalram_pages += pgdat->node_totalram_pages; + } +#else for_each_pgdat (pgdat) totalram_pages +=free_all_bootmem_node (pgdat); +#endif reserved_pages =0 ;efi_memmap_walk (count_reserved_pages, &reserved_pages);
include/linux/mmzone.h +3 -0
@@ -240,6 +240,9 @@ typedef struct pglist_data {wait_queue_head_t kswapd_wait;struct task_struct *kswapd;char removable, enabled; +#ifdef CONFIG_MEMHOTPLUG +unsigned long node_totalram_pages; +#endif } pg_data_t;#define node_present_pages (nid) (NODE_DATA(nid)->node_present_pages)
mm/page_alloc.c +7 -1
@@ -1218,6 +1218,7 @@ static int build_zonelists_node(pg_data_ }#ifdef CONFIG_NUMA +#if 0 #define MAX_NODE_LOAD (numnodes)static int __initdata node_load[MAX_NUMNODES ];/**
@@ -1322,6 +1323,7 @@ static void __init build_zonelists(pg_da }#else /* CONFIG_NUMA */ +#endif static void build_zonelists (pg_data_t *pgdat) {
@@ -1621,6 +1623,7 @@ free_area_init_core(struct pglist_data * zone->wait_table_size =wait_table_size (size); zone->wait_table_bits =wait_table_bits (zone->wait_table_size); +#if 0 #ifdef CONFIG_MEMHOTPLUG if (!cold) zone->wait_table = (wait_queue_head_t *)
@@ -1628,10 +1631,11 @@ free_area_init_core(struct pglist_data * * sizeof(wait_queue_head_t), GFP_KERNEL); else#endif +#endif zone->wait_table = (wait_queue_head_t *)alloc_bootmem_node (pgdat, zone->wait_table_size *sizeof (wait_queue_head_t)); - +for (i =0 ; i < zone->wait_table_size; ++i)init_waitqueue_head (zone->wait_table + i);
@@ -1682,6 +1686,7 @@ free_area_init_core(struct pglist_data **/ bitmap_size = (size-1 ) >> (i+4 ); bitmap_size =LONG_ALIGN (bitmap_size+1 ); +#if 0 #ifdef CONFIG_MEMHOTPLUG if (!cold) { zone->free_area[i].map =
@@ -1689,6 +1694,7 @@ free_area_init_core(struct pglist_data *memset (zone->free_area[i].map,0 , bitmap_size); } else#endif +#endif zone->free_area[i].map = (unsigned long *)alloc_bootmem_node (pgdat, bitmap_size); }