From: Andrew Morton Cc: KAMEZAWA Hiroyuki Cc: Yasunori Goto Signed-off-by: Andrew Morton --- mm/page_alloc.c | 44 ++++++++++++++++++++------------------------ 1 files changed, 20 insertions(+), 24 deletions(-) diff -puN mm/page_alloc.c~wait_table-and-zonelist-initializing-for-memory-hotadd-wait_table-initialization-fixes mm/page_alloc.c --- 25/mm/page_alloc.c~wait_table-and-zonelist-initializing-for-memory-hotadd-wait_table-initialization-fixes Tue Apr 11 14:32:44 2006 +++ 25-akpm/mm/page_alloc.c Tue Apr 11 14:32:44 2006 @@ -1738,25 +1738,21 @@ static inline unsigned long wait_table_h } #else /* - * XXX: Because zone size might be changed by hot-add, - * It is hard to determin suitable value for wait_table as traditional. - * So, we use maximum entries now. + * A zone's size might be changed by hot-add, so it is not possible to determine + * a suitable size for its wait_table. So we use the maximum size now. * - * The max wait table size = 4096 x sizeof(wait_queue_head_t) byte. - * ex: - * i386 (preemption config) : 4096 x 16 = 64Kbyte. - * ia64, x86-64 (no preemption): 4096 x 20 = 80Kbyte. - * ia64, x86-64 (preemption) : 4096 x 24 = 96Kbyte. + * The max wait table size = 4096 x sizeof(wait_queue_head_t). ie: * - * The maximum entries are prepared when a zone's memory is - * (512K + 256) pages or more by traditional way. (See above) - * It equals .... - * i386, x86-64, powerpc(4K page size) : = ( 2G + 1M)byte. - * ia64(16K page size) : = ( 8G + 4M)byte. - * powerpc (64K page size) : = (32G +16M)byte. + * i386 (preemption config) : 4096 x 16 = 64Kbyte. + * ia64, x86-64 (no preemption): 4096 x 20 = 80Kbyte. + * ia64, x86-64 (preemption) : 4096 x 24 = 96Kbyte. * - * If system doesn't have this size or more memory in the future, - * wait_table might be too bigger than suitable. + * The maximum entries are prepared when a zone's memory is (512K + 256) pages + * or more by the traditional way. (See above). It equals: + * + * i386, x86-64, powerpc(4K page size) : = ( 2G + 1M)byte. + * ia64(16K page size) : = ( 8G + 4M)byte. + * powerpc (64K page size) : = (32G +16M)byte. */ static inline unsigned long wait_table_hash_nr_entries(unsigned long pages) { @@ -2050,14 +2046,14 @@ int zone_wait_table_init(struct zone *zo alloc_bootmem_node(pgdat, alloc_size); } else { /* - * XXX: This case means that a zone whose size was 0 gets new - * memory by memory hot-add. - * But, this may be the case that "new node" is hotadded. - * If its case, vmalloc() will not get this new node's - * memory. Because this wait_table must be initialized - * to use this new node itself too. - * To use this new node's memory, further consideration - * will be necessary. + * This case means that a zone whose size was 0 gets new memory + * via memory hot-add. + * But it may be the case that a new node was hot-added. In + * this case vmalloc() will not be able to use this new node's + * memory - this wait_table must be initialized to use this new + * node itself as well. + * To use this new node's memory, further consideration will be + * necessary. */ zone->wait_table = (wait_queue_head_t *)vmalloc(alloc_size); } _