[lkml]   [2008]   [Aug]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [Bug #11342] Linux 2.6.27-rc3: kernel BUG at mm/vmalloc.c - bisected

On Tue, 26 Aug 2008, Yinghai Lu wrote:
> wonder if could use "unsigned long *" directly.

I would actually suggest something like this:

- we continue to have a magic "cpumask_t".

- we do different cases for big and small NR_CPUS:


* Make it an array - that way passing it as an argument will
* always pass it as a pointer!
typedef unsigned long cpumask_t[1];
static inline void create_cpumask(cpumask_t *p)
*p = 0;
static inline void free_cpumask(cpumask_t *p)

typedef unsigned long *cpumask_t;

static inline void create_cpumask(cpumask_t *p)
*p = kcalloc(..);
static inline void free_cpumask(cpumask_t *p)

and now after you do this, you can just do something like

cpumask_t mycpu;


and in between, you can use 'cpumask' as a pointer, because even when it
is an array directly allocated on the stack, the array can always
degenerate into a pointer by C type rules!

And for the small-NR_CPUS case there is zero overhead.


 \ /
  Last update: 2008-08-26 18:57    [from the cache]
©2003-2014 Jasper Spaans. hosted at Digital Ocean