Re: [PATCH] cpumask 10/10 optimize various uses of new cpumasks

Nick Piggin
2004-06-04T04:40:49Z

Rusty Russell wrote:
> On Fri, 2004-06-04 at 03:11, Paul Jackson wrote:
>
>>cpumask 10/10 optimize various uses of new cpumasks
>>
>> Make use of for_each_cpu_mask() macro to simplify and optimize
>> a couple of sparc64 per-CPU loops.
>
>
> This means we can finally do this, too... Yes!
>
> Name: Cleanup cpumask_t Temporaries
> Status: Booted on 2.6.7-rc2-bk4
> Depends: Misc/cpumask-tour-de-force.patch.gz
> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
>
> Paul Jackson's cpumask tour-de-force allows us to get rid of those
> stupid temporaries which we used to hold CPU_MASK_ALL to hand them to
> functions. This used to break NR_CPUS > BITS_PER_LONG.

Actually I think this was already possible as of a couple of
months ago, but thanks for doing the cleanup :)

Fix was embarrassingly simple as pointed out by Linus:

-#define CPU_MASK_ALL { {[0 ... CPU_ARRAY_SIZE-1] = ~0UL} }
-#define CPU_MASK_NONE { {[0 ... CPU_ARRAY_SIZE-1] = 0UL} }
+#define CPU_MASK_ALL ((cpumask_t) { {[0 ... CPU_ARRAY_SIZE-1] = ~0UL} })
+#define CPU_MASK_NONE ((cpumask_t) { {[0 ... CPU_ARRAY_SIZE-1] = 0UL} })