--- include/linux/cpumask.h | 12 +----------- include/linux/percpu.h | 2 ++ kernel/sched.c | 6 ++++++ 3 files changed, 9 insertions(+), 11 deletions(-) Index: linux-2.6/include/linux/cpumask.h =================================================================== --- linux-2.6.orig/include/linux/cpumask.h 2007-11-17 17:10:13.508534650 -0800 +++ linux-2.6/include/linux/cpumask.h 2007-11-17 17:11:34.816785513 -0800 @@ -222,17 +222,7 @@ int __next_cpu(int n, const cpumask_t *s #define next_cpu(n, src) 1 #endif -#define cpumask_of_cpu(cpu) \ -({ \ - typeof(_unused_cpumask_arg_) m; \ - if (sizeof(m) == sizeof(unsigned long)) { \ - m.bits[0] = 1UL<<(cpu); \ - } else { \ - cpus_clear(m); \ - cpu_set((cpu), m); \ - } \ - m; \ -}) +#define cpumask_of_cpu(cpu) per_cpu(cpu_mask, cpu) #define CPU_MASK_LAST_WORD BITMAP_LAST_WORD_MASK(NR_CPUS) Index: linux-2.6/include/linux/percpu.h =================================================================== --- linux-2.6.orig/include/linux/percpu.h 2007-11-17 17:10:13.516534409 -0800 +++ linux-2.6/include/linux/percpu.h 2007-11-17 17:11:34.816785513 -0800 @@ -21,6 +21,8 @@ (__per_cpu_end - __per_cpu_start + PERCPU_MODULE_RESERVE) #endif /* PERCPU_ENOUGH_ROOM */ +DECLARE_PER_CPU(cpumask_t, cpu_mask); + /* * Must be an lvalue. Since @var must be a simple identifier, * we force a syntax error here if it isn't. Index: linux-2.6/kernel/sched.c =================================================================== --- linux-2.6.orig/kernel/sched.c 2007-11-17 17:10:13.524534454 -0800 +++ linux-2.6/kernel/sched.c 2007-11-17 17:11:34.816785513 -0800 @@ -6725,6 +6725,9 @@ static void init_cfs_rq(struct cfs_rq *c cfs_rq->min_vruntime = (u64)(-(1LL << 20)); } +DEFINE_PER_CPU(cpumask_t, cpu_mask); +EXPORT_PER_CPU_SYMBOL(cpu_mask); + void __init sched_init(void) { int highest_cpu = 0; @@ -6734,6 +6737,9 @@ void __init sched_init(void) struct rt_prio_array *array; struct rq *rq; + /* This makes cpumask_of_cpu work */ + cpu_set(i, per_cpu(cpu_mask, i)); + rq = cpu_rq(i); spin_lock_init(&rq->lock); lockdep_set_class(&rq->lock, &rq->rq_lock_key);