cpumask: make cpumask_of_cpu_map generic

Previous thread: ipwireless: fix compile failure by Linux Kernel Mailing List on Monday, July 28, 2008 - 3:59 pm. (1 message)

Next thread: cpumask: put cpumask_of_cpu_map in the initdata section by Linux Kernel Mailing List on Monday, July 28, 2008 - 3:59 pm. (1 message)
From: Linux Kernel Mailing List
Date: Monday, July 28, 2008 - 3:59 pm

Gitweb:     http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b8d317...
Commit:     b8d317d10cca76cabe6b03ebfeb23cc99118b731
Parent:     024e8ac04453b3525448c31ef39848cf675ba6db
Author:     Mike Travis <travis@sgi.com>
AuthorDate: Thu Jul 24 18:21:29 2008 -0700
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Sat Jul 26 16:40:32 2008 +0200

    cpumask: make cpumask_of_cpu_map generic
    
    If an arch doesn't define cpumask_of_cpu_map, create a generic
    statically-initialized one for them.  This allows removal of the buggy
    cpumask_of_cpu() macro (&cpumask_of_cpu() gives address of
    out-of-scope var).
    
    An arch with NR_CPUS of 4096 probably wants to allocate this itself
    based on the actual number of CPUs, since otherwise they're using 2MB
    of rodata (1024 cpus means 128k).  That's what
    CONFIG_HAVE_CPUMASK_OF_CPU_MAP is for (only x86/64 does so at the
    moment).
    
    In future as we support more CPUs, we'll need to resort to a
    get_cpu_map()/put_cpu_map() allocation scheme.
    
    Signed-off-by: Mike Travis <travis@sgi.com>
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    Cc: Andrew Morton <akpm@linux-foundation.org>
    Cc: Jack Steiner <steiner@sgi.com>
    Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 include/linux/cpumask.h |   41 +----------------
 kernel/cpu.c            |  109 +++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 112 insertions(+), 38 deletions(-)

diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h
index 1b5c98e..8fa3b6d 100644
--- a/include/linux/cpumask.h
+++ b/include/linux/cpumask.h
@@ -62,15 +62,7 @@
  * int next_cpu_nr(cpu, mask)		Next cpu past 'cpu', or nr_cpu_ids
  *
  * cpumask_t cpumask_of_cpu(cpu)	Return cpumask with bit 'cpu' set
- *ifdef CONFIG_HAS_CPUMASK_OF_CPU
- * cpumask_of_cpu_ptr_declare(v)	Declares cpumask_t *v
- * cpumask_of_cpu_ptr_next(v, cpu)	Sets v = &cpumask_of_cpu_map[cpu]
- ...
Previous thread: ipwireless: fix compile failure by Linux Kernel Mailing List on Monday, July 28, 2008 - 3:59 pm. (1 message)

Next thread: cpumask: put cpumask_of_cpu_map in the initdata section by Linux Kernel Mailing List on Monday, July 28, 2008 - 3:59 pm. (1 message)