forked from mirrors/linux
		
	[PATCH] pgdat allocation for new node add (get node id by acpi)
This is to find node id from acpi's handle of memory_device in DSDT. _PXM for the new node can be found by acpi_get_pxm() by using new memory's handle. So, node id can be found by pxm_to_nid_map[]. This patch becomes simpler than v2 of node hot-add patch. Because old add_memory() function doesn't have node id parameter. So, kernel must find its handle by physical address via DSDT again. But, v3 just give node id to add_memory() now. Signed-off-by: Yasunori Goto <y-goto@jp.fujitsu.com> Cc: Dave Hansen <haveblue@us.ibm.com> Cc: "Brown, Len" <len.brown@intel.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
		
							parent
							
								
									bc02af93dd
								
							
						
					
					
						commit
						1e3590e2e4
					
				
					 3 changed files with 22 additions and 2 deletions
				
			
		| 
						 | 
					@ -215,7 +215,7 @@ static int acpi_memory_enable_device(struct acpi_memory_device *mem_device)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	int result, num_enabled = 0;
 | 
						int result, num_enabled = 0;
 | 
				
			||||||
	struct acpi_memory_info *info;
 | 
						struct acpi_memory_info *info;
 | 
				
			||||||
	int node = 0;
 | 
						int node;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	ACPI_FUNCTION_TRACE("acpi_memory_enable_device");
 | 
						ACPI_FUNCTION_TRACE("acpi_memory_enable_device");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -228,6 +228,7 @@ static int acpi_memory_enable_device(struct acpi_memory_device *mem_device)
 | 
				
			||||||
		return result;
 | 
							return result;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						node = acpi_get_node(mem_device->handle);
 | 
				
			||||||
	/*
 | 
						/*
 | 
				
			||||||
	 * Tell the VM there is more memory here...
 | 
						 * Tell the VM there is more memory here...
 | 
				
			||||||
	 * Note: Assume that this function returns zero on success
 | 
						 * Note: Assume that this function returns zero on success
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -254,5 +254,18 @@ int acpi_get_pxm(acpi_handle h)
 | 
				
			||||||
	} while (ACPI_SUCCESS(status));
 | 
						} while (ACPI_SUCCESS(status));
 | 
				
			||||||
	return -1;
 | 
						return -1;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					 | 
				
			||||||
EXPORT_SYMBOL(acpi_get_pxm);
 | 
					EXPORT_SYMBOL(acpi_get_pxm);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					int acpi_get_node(acpi_handle *handle)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						int pxm, node = -1;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						ACPI_FUNCTION_TRACE("acpi_get_node");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						pxm = acpi_get_pxm(handle);
 | 
				
			||||||
 | 
						if (pxm >= 0)
 | 
				
			||||||
 | 
							node = acpi_map_pxm_to_node(pxm);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						return_VALUE(node);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					EXPORT_SYMBOL(acpi_get_node);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -528,12 +528,18 @@ static inline void acpi_set_cstate_limit(unsigned int new_limit) { return; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#ifdef CONFIG_ACPI_NUMA
 | 
					#ifdef CONFIG_ACPI_NUMA
 | 
				
			||||||
int acpi_get_pxm(acpi_handle handle);
 | 
					int acpi_get_pxm(acpi_handle handle);
 | 
				
			||||||
 | 
					int acpi_get_node(acpi_handle *handle);
 | 
				
			||||||
#else
 | 
					#else
 | 
				
			||||||
static inline int acpi_get_pxm(acpi_handle handle)
 | 
					static inline int acpi_get_pxm(acpi_handle handle)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					static inline int acpi_get_node(acpi_handle *handle)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						return 0;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					extern int acpi_paddr_to_node(u64 start_addr, u64 size);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
extern int pnpacpi_disabled;
 | 
					extern int pnpacpi_disabled;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue