Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 136443
b: refs/heads/master
c: e7a22c1
h: refs/heads/master
i:
  136441: 36e7c44
  136439: f6e037b
v: v3
  • Loading branch information
Brian Gerst authored and Tejun Heo committed Jan 18, 2009
1 parent e910b11 commit ca914d9
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 11 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: 5689553076c4a67b83426b076082c63085b7567a
refs/heads/master: e7a22c1ebcc1caa8178df1819d05128bb5b45ab9
1 change: 0 additions & 1 deletion trunk/arch/x86/include/asm/pda.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ struct x8664_pda {
/* gcc-ABI: this canary MUST be at
offset 40!!! */
#endif
short nodenumber; /* number of current node (32k max) */
short in_bootmem; /* pda lives in bootmem */
short isidle;
} ____cacheline_aligned_in_smp;
Expand Down
3 changes: 2 additions & 1 deletion trunk/arch/x86/include/asm/topology.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ extern cpumask_t *node_to_cpumask_map;
DECLARE_EARLY_PER_CPU(int, x86_cpu_to_node_map);

/* Returns the number of the current Node. */
#define numa_node_id() read_pda(nodenumber)
DECLARE_PER_CPU(int, node_number);
#define numa_node_id() percpu_read(node_number)

#ifdef CONFIG_DEBUG_PER_CPU_MAPS
extern int cpu_to_node(int cpu);
Expand Down
13 changes: 6 additions & 7 deletions trunk/arch/x86/kernel/cpu/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -897,18 +897,11 @@ DEFINE_PER_CPU(unsigned int, irq_count) = -1;

void __cpuinit pda_init(int cpu)
{
struct x8664_pda *pda = cpu_pda(cpu);

/* Setup up data that may be needed in __get_free_pages early */
loadsegment(fs, 0);
loadsegment(gs, 0);

load_pda_offset(cpu);

if (cpu != 0) {
if (pda->nodenumber == 0 && cpu_to_node(cpu) != NUMA_NO_NODE)
pda->nodenumber = cpu_to_node(cpu);
}
}

static DEFINE_PER_CPU_PAGE_ALIGNED(char, exception_stacks
Expand Down Expand Up @@ -978,6 +971,12 @@ void __cpuinit cpu_init(void)
if (cpu != 0)
pda_init(cpu);

#ifdef CONFIG_NUMA
if (cpu != 0 && percpu_read(node_number) == 0 &&
cpu_to_node(cpu) != NUMA_NO_NODE)
percpu_write(node_number, cpu_to_node(cpu));
#endif

me = current;

if (cpumask_test_and_set_cpu(cpu, cpu_initialized_mask))
Expand Down
4 changes: 3 additions & 1 deletion trunk/arch/x86/kernel/setup_percpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ EXPORT_EARLY_PER_CPU_SYMBOL(x86_bios_cpu_apicid);

#if defined(CONFIG_NUMA) && defined(CONFIG_X86_64)
#define X86_64_NUMA 1 /* (used later) */
DEFINE_PER_CPU(int, node_number) = 0;
EXPORT_PER_CPU_SYMBOL(node_number);

/*
* Map cpu index to node index
Expand Down Expand Up @@ -283,7 +285,7 @@ void __cpuinit numa_set_node(int cpu, int node)
per_cpu(x86_cpu_to_node_map, cpu) = node;

if (node != NUMA_NO_NODE)
cpu_pda(cpu)->nodenumber = node;
per_cpu(node_number, cpu) = node;
}

void __cpuinit numa_clear_node(int cpu)
Expand Down

0 comments on commit ca914d9

Please sign in to comment.