Re: [PATCH] percpu data: only iterate over possible CPUs



Heiko Carstens a écrit :
tree 8c30052a0d7fadec37c785a42a71b28d0a9c5fcf
parent cef5076987dd545ac74f4efcf1c962be8eac34b0
author Eric Dumazet <dada1@xxxxxxxxxxxxx> Sun, 05 Feb 2006 15:27:36 -0800
committer Linus Torvalds <torvalds@xxxxxxxxxxx> Mon, 06 Feb 2006 03:06:51 -0800

[PATCH] percpu data: only iterate over possible CPUs

percpu_data blindly allocates bootmem memory to store NR_CPUS instances of
cpudata, instead of allocating memory only for possible cpus.

As a preparation for changing that, we need to convert various 0 -> NR_CPUS
loops to use for_each_cpu().

(The above only applies to users of asm-generic/percpu.h. powerpc has gone it
alone and is presently only allocating memory for present CPUs, so it's
currently corrupting memory).

This patch is broken since it replaces several loops that iterate NR_CPUS
times with for_each_cpu before cpu_possible_map is setup:

This patch assumes that cpu_possible_map is setup before setup_per_cpu_areas().

That sounds a reasonable assumption, but maybe not on your architecture ?

I dont think cpu_possible_map has to be filled at smp_prepare_cpus() time, but long before.

On i386/x86_64/ia64, this is done from setup_arch() called from start_kernel() just before setup_per_cpu_areas()

On powerpc it's done from setup_system(), called before start_kernel()

Eric


-
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/



Relevant Pages

  • Re: [PATCH] percpu data: only iterate over possible CPUs
    ... instead of allocating memory only for possible cpus. ... This patch is broken since it replaces several loops that iterate NR_CPUS ...
    (Linux-Kernel)
  • [PATCH 0/6 v5] Kernel handling of Dynamic Logical Partitioning
    ... The Dynamic Logical Partitioning (DLPAR) capabilities of the powerpc pseries ... memory, ... kernel handle the DLPAR addition and removal of memory and cpus (other ...
    (Linux-Kernel)
  • Re: 2nd CPU on a Sun Blade 2000 problem
    ... memory) and left the original in the '0' slot? ... will only find in a Sun Fire 280R (uses the same CPUs and system board, ... but is a rack mount server, and the RSC card allows "LOM" (Lights Out ... framebuffer slot -- and there is no way to use a UPA framebuffer in the ...
    (comp.sys.sun.hardware)
  • Re: [Announce]: Target_Core_Mod/ConfigFS and LIO-Target v3.0 work
    ... allocations would help the performance of a storage target. ... A single codepath memory allocating *AND* mapping for: ... Allocating multiple contigious struct page from the memory allocator ... I never claimed that RDMA is only possible from user space -- that was ...
    (Linux-Kernel)
  • Re: Lies, Damn Lies and Statistics...
    ... I've never looked at the source code of either IDS or DB2. ... binds sessons to engines hence if the engine is busy ... dynamically add shared memory segments on Linux. ... CPUs, as it sees fit. ...
    (comp.databases.informix)