Skip to content

Commit 3dd6b5f

Browse files
Lee Schermerhorntorvalds
authored andcommitted
numa: in-kernel profiling: use cpu_to_mem() for per cpu allocations
In kernel profiling requires that we be able to allocate "local" memory for each cpu. Use "cpu_to_mem()" instead of "cpu_to_node()" to support memoryless nodes. Depends on the "numa_mem_id()" patch. Signed-off-by: Lee Schermerhorn <lee.schermerhorn@hp.com> Cc: Tejun Heo <tj@kernel.org> Cc: Mel Gorman <mel@csn.ul.ie> Cc: Christoph Lameter <cl@linux-foundation.org> Cc: Nick Piggin <npiggin@suse.de> Cc: David Rientjes <rientjes@google.com> Cc: Eric Whitney <eric.whitney@hp.com> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: "H. Peter Anvin" <hpa@zytor.com> Cc: "Luck, Tony" <tony.luck@intel.com> Cc: Pekka Enberg <penberg@cs.helsinki.fi> Cc: <linux-arch@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 7d6e6d0 commit 3dd6b5f

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎kernel/profile.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ static int __cpuinit profile_cpu_callback(struct notifier_block *info,
365365
switch (action) {
366366
case CPU_UP_PREPARE:
367367
case CPU_UP_PREPARE_FROZEN:
368-
node = cpu_to_node(cpu);
368+
node = cpu_to_mem(cpu);
369369
per_cpu(cpu_profile_flip, cpu) = 0;
370370
if (!per_cpu(cpu_profile_hits, cpu)[1]) {
371371
page = alloc_pages_exact_node(node,
@@ -567,7 +567,7 @@ static int create_hash_tables(void)
567567
int cpu;
568568

569569
for_each_online_cpu(cpu) {
570-
int node = cpu_to_node(cpu);
570+
int node = cpu_to_mem(cpu);
571571
struct page *page;
572572

573573
page = alloc_pages_exact_node(node,

0 commit comments

Comments
 (0)