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

From: Nick Piggin
Date: Thu Jun 03 2004 - 23:41:56 EST


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@xxxxxxxxxxxxxxx>

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} })
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/