lkml.org 
[lkml]   [2008]   [Jul]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [git pull] cpus4096 fixes


On Mon, 28 Jul 2008, Linus Torvalds wrote:
>
> Here's a trivial setup, that is even tested. It's _small_ too.
>
> /* cpu_bit_bitmap[0] is empty - so we can back into it */
> #define MASK_DECLARE_1(x) [x+1][0] = 1ul << (x)
> #define MASK_DECLARE_2(x) MASK_DECLARE_1(x), MASK_DECLARE_1(x+1)
> #define MASK_DECLARE_4(x) MASK_DECLARE_2(x), MASK_DECLARE_2(x+2)
> #define MASK_DECLARE_8(x) MASK_DECLARE_4(x), MASK_DECLARE_4(x+4)
>
> static const unsigned long cpu_bit_bitmap[BITS_PER_LONG+1][BITS_TO_LONGS(NR_CPUS)] = {
> MASK_DECLARE_8(0), MASK_DECLARE_8(8),
> MASK_DECLARE_8(16), MASK_DECLARE_8(24),
> #if BITS_PER_LONG > 32
> MASK_DECLARE_8(32), MASK_DECLARE_8(40),
> MASK_DECLARE_8(48), MASK_DECLARE_8(56),
> #endif
> };
>
> static inline const cpumask_t *get_cpu_mask(unsigned int nr)
> {
> const unsigned long *p = cpu_bit_bitmap[1 + nr % BITS_PER_LONG];
> p -= nr / BITS_PER_LONG;
> return (const cpumask_t *)p;
> }

Btw, Ingo, can we get this issue resolved asap, please?

I was planning on doing -rc1 today, but this kind of hangs over me. The
above three lines of code (and more lines of macro initializers) obviously
does need some more testing, but if you hook it into the other changes you
already had, maybe we can get it done.

Hmm?

Linus


\
 
 \ /
  Last update: 2008-07-28 20:43    [W:0.120 / U:1.656 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site