Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 356531
b: refs/heads/master
c: e13fe86
h: refs/heads/master
i:
  356529: 8f66696
  356527: c3e046d
v: v3
  • Loading branch information
Wen Congyang authored and Linus Torvalds committed Feb 24, 2013
1 parent 4d93524 commit 58860ed
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 76bba1423f6313ccf7bd7cd400f1f2049bbc740a
refs/heads/master: e13fe8695c57fed678877a9f3f8e99fc637ff4fb
4 changes: 2 additions & 2 deletions trunk/arch/x86/include/asm/numa.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ static inline int numa_cpu_node(int cpu)
#endif

#ifdef CONFIG_NUMA
extern void __cpuinit numa_set_node(int cpu, int node);
extern void __cpuinit numa_clear_node(int cpu);
extern void numa_set_node(int cpu, int node);
extern void numa_clear_node(int cpu);
extern void __init init_cpu_to_node(void);
extern void __cpuinit numa_add_cpu(int cpu);
extern void __cpuinit numa_remove_cpu(int cpu);
Expand Down
4 changes: 2 additions & 2 deletions trunk/arch/x86/mm/numa.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ EXPORT_SYMBOL(node_to_cpumask_map);
DEFINE_EARLY_PER_CPU(int, x86_cpu_to_node_map, NUMA_NO_NODE);
EXPORT_EARLY_PER_CPU_SYMBOL(x86_cpu_to_node_map);

void __cpuinit numa_set_node(int cpu, int node)
void numa_set_node(int cpu, int node)
{
int *cpu_to_node_map = early_per_cpu_ptr(x86_cpu_to_node_map);

Expand All @@ -101,7 +101,7 @@ void __cpuinit numa_set_node(int cpu, int node)
set_cpu_numa_node(cpu, node);
}

void __cpuinit numa_clear_node(int cpu)
void numa_clear_node(int cpu)
{
numa_set_node(cpu, NUMA_NO_NODE);
}
Expand Down
30 changes: 29 additions & 1 deletion trunk/mm/memory_hotplug.c
Original file line number Diff line number Diff line change
Expand Up @@ -1705,6 +1705,34 @@ static int check_cpu_on_node(void *data)
return 0;
}

static void unmap_cpu_on_node(void *data)
{
#ifdef CONFIG_ACPI_NUMA
struct pglist_data *pgdat = data;
int cpu;

for_each_possible_cpu(cpu)
if (cpu_to_node(cpu) == pgdat->node_id)
numa_clear_node(cpu);
#endif
}

static int check_and_unmap_cpu_on_node(void *data)
{
int ret = check_cpu_on_node(data);

if (ret)
return ret;

/*
* the node will be offlined when we come here, so we can clear
* the cpu_to_node() now.
*/

unmap_cpu_on_node(data);
return 0;
}

/* offline the node if all memory sections of this node are removed */
void try_offline_node(int nid)
{
Expand All @@ -1731,7 +1759,7 @@ void try_offline_node(int nid)
return;
}

if (stop_machine(check_cpu_on_node, pgdat, NULL))
if (stop_machine(check_and_unmap_cpu_on_node, pgdat, NULL))
return;

/*
Expand Down

0 comments on commit 58860ed

Please sign in to comment.