]> git.hungrycats.org Git - linux/commit
[PATCH] Make for_each_cpu() Iterator More Friendly
authorAndrew Morton <akpm@osdl.org>
Mon, 19 Jan 2004 02:30:46 +0000 (18:30 -0800)
committerLinus Torvalds <torvalds@home.osdl.org>
Mon, 19 Jan 2004 02:30:46 +0000 (18:30 -0800)
commit90c7f71962cc5aa0bf128ce68b9a8607176558c4
tree7b87fb6841823766767b085428b4a3a6d6717717
parent8e197efaae27d6492eba4e6c42d041da61d3d40d
[PATCH] Make for_each_cpu() Iterator More Friendly

From: Rusty Russell <rusty@rustcorp.com.au>

Anton: breaks PPC64, as it needs cpu_possible_mask, but fix is already
in Ameslab tree.

The for_each_cpu() and for_each_online_cpu() iterators take a mask, and
noone uses them that way (except for arch/i386/mach-voyager, which uses
for_each_cpu(cpu_online_mask).  Make them more usable iterators, by
dropping the "mask" arg.

This requires that archs provide a cpu_possible_mask: most do, but PPC64
doesn't, so it is broken by this patch.  The other archs use a #define to
define it in asm/smp.h.

Most places doing loops over cpus testing for cpu_online() should use
for_each_cpu: it is synonymous at the moment, but with the CPU hotplug
patch the difference becomes important.

Followup patches will convert users.
14 files changed:
arch/i386/mach-voyager/voyager_smp.c
include/asm-alpha/smp.h
include/asm-i386/smp.h
include/asm-ia64/smp.h
include/asm-mips/smp.h
include/asm-parisc/smp.h
include/asm-ppc/smp.h
include/asm-s390/smp.h
include/asm-sh/smp.h
include/asm-sparc64/smp.h
include/asm-um/smp.h
include/asm-x86_64/smp.h
include/linux/cpumask.h
include/linux/smp.h