• Andrew Morton's avatar
    [PATCH] Make for_each_cpu() Iterator More Friendly · 90c7f719
    Andrew Morton authored
    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.
    90c7f719
smp.h 1005 Bytes