Skip to content

Commit 9dda696

Browse files
committed
Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6
* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6: [IA64] Fix build breakage
2 parents c5617b2 + 4ec37de commit 9dda696

2 files changed

Lines changed: 21 additions & 0 deletions

File tree

‎arch/ia64/kernel/smpboot.c‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,11 +390,13 @@ smp_callin (void)
390390

391391
fix_b0_for_bsp();
392392

393+
#ifdef CONFIG_NUMA
393394
/*
394395
* numa_node_id() works after this.
395396
*/
396397
set_numa_node(cpu_to_node_map[cpuid]);
397398
set_numa_mem(local_memory_node(cpu_to_node_map[cpuid]));
399+
#endif
398400

399401
ipi_call_lock_irq();
400402
spin_lock(&vector_lock);
@@ -638,7 +640,9 @@ void __devinit smp_prepare_boot_cpu(void)
638640
{
639641
cpu_set(smp_processor_id(), cpu_online_map);
640642
cpu_set(smp_processor_id(), cpu_callin_map);
643+
#ifdef CONFIG_NUMA
641644
set_numa_node(cpu_to_node_map[smp_processor_id()]);
645+
#endif
642646
per_cpu(cpu_state, smp_processor_id()) = CPU_ONLINE;
643647
paravirt_post_smp_prepare_boot_cpu();
644648
}

‎arch/ia64/mm/numa.c‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include <linux/init.h>
1818
#include <linux/bootmem.h>
1919
#include <linux/module.h>
20+
#include <linux/random.h>
2021
#include <asm/mmzone.h>
2122
#include <asm/numa.h>
2223

@@ -50,6 +51,22 @@ paddr_to_nid(unsigned long paddr)
5051
return (i < num_node_memblks) ? node_memblk[i].nid : (num_node_memblks ? -1 : 0);
5152
}
5253

54+
/*
55+
* Return the bit number of a random bit set in the nodemask.
56+
* (returns -1 if nodemask is empty)
57+
*/
58+
int __node_random(const nodemask_t *maskp)
59+
{
60+
int w, bit = -1;
61+
62+
w = nodes_weight(*maskp);
63+
if (w)
64+
bit = bitmap_ord_to_pos(maskp->bits,
65+
get_random_int() % w, MAX_NUMNODES);
66+
return bit;
67+
}
68+
EXPORT_SYMBOL(__node_random);
69+
5370
#if defined(CONFIG_SPARSEMEM) && defined(CONFIG_NUMA)
5471
/*
5572
* Because of holes evaluate on section limits.

0 commit comments

Comments
 (0)