30 Mar, 2009

1 commit


08 Jan, 2009

1 commit

  • disable_nonboot_cpus calls _cpu_down. But _cpu_down requires that the
    caller already created the stop_machine workqueue (like cpu_down does).
    Otherwise a call to stop_machine will lead to accesses to random memory
    regions.

    When introducing this new interface (9ea09af3bd3090e8349ca2899ca2011bd94cda85
    "stop_machine: introduce stop_machine_create/destroy") I missed the second
    call site of _cpu_down.
    So add the missing stop_machine_create/destroy calls to disable_nonboot_cpus
    as well.

    Fixes suspend-to-ram/disk and also this bug:

    [ 286.547348] BUG: unable to handle kernel paging request at 6b6b6b6b
    [ 286.548940] IP: [] __stop_machine+0x88/0xe3
    [ 286.550598] Oops: 0002 [#1] SMP
    [ 286.560580] Pid: 3273, comm: halt Not tainted (2.6.28-06127-g238c6d5
    [ 286.560580] EIP: is at __stop_machine+0x88/0xe3
    [ 286.560580] Process halt (pid: 3273, ti=f1a28000 task=f4530f30
    [ 286.560580] Call Trace:
    [ 286.560580] [] ? _cpu_down+0x10f/0x234
    [ 286.560580] [] ? disable_nonboot_cpus+0x58/0xdc
    [ 286.560580] [] ? kernel_poweroff+0x22/0x39
    [ 286.560580] [] ? sys_reboot+0xde/0x14c
    [ 286.560580] [] ? complete_signal+0x179/0x191
    [ 286.560580] [] ? send_signal+0x1cc/0x1e1
    [ 286.560580] [] ? _spin_unlock_irqrestore+0x2d/0x3c
    [ 286.560580] [] ? group_send_signal_info+0x58/0x61
    [ 286.560580] [] ? kill_pid_info+0x30/0x3a
    [ 286.560580] [] ? sys_kill+0x75/0x13a
    [ 286.560580] [] ? mntput_no_expire+ox1f/0x101
    [ 286.560580] [] ? dput+0x1e/0x105
    [ 286.560580] [] ? __fput+0x150/0x158
    [ 286.560580] [] ? audit_syscall_entry+0x137/0x159
    [ 286.560580] [] ? sysenter_do_call+0x12/0x34

    Reported-and-tested-by: "Justin P. Mattock"
    Reviewed-by: Pekka Enberg
    Signed-off-by: Heiko Carstens
    Tested-by: Ingo Molnar
    Signed-off-by: Linus Torvalds

    Heiko Carstens
     

05 Jan, 2009

1 commit

  • Introduce stop_machine_create/destroy. With this interface subsystems
    that need a non-failing stop_machine environment can create the
    stop_machine machine threads before actually calling stop_machine.
    When the threads aren't needed anymore they can be killed with
    stop_machine_destroy again.

    When stop_machine gets called and the threads aren't present they
    will be created and destroyed automatically. This restores the old
    behaviour of stop_machine.

    This patch also converts cpu hotplug to the new interface since it
    is special: cpu_down calls __stop_machine instead of stop_machine.
    However the kstop threads will only be created when stop_machine
    gets called.

    Changing the code so that the threads would be created automatically
    on __stop_machine is currently not possible: when __stop_machine gets
    called we hold cpu_add_remove_lock, which is the same lock that
    create_rt_workqueue would take. So the workqueue needs to be created
    before the cpu hotplug code locks cpu_add_remove_lock.

    Signed-off-by: Heiko Carstens
    Signed-off-by: Rusty Russell

    Heiko Carstens
     

01 Jan, 2009

1 commit

  • Impact: Reduce kernel stack and memory usage, use new cpumask API.

    Use cpumask_var_t for take_cpu_down() stack var, and frozen_cpus.

    Note that notify_cpu_starting() can be called before core_initcall
    allocates frozen_cpus, but the NULL check is optimized out by gcc for
    the CONFIG_CPUMASK_OFFSTACK=n case.

    Signed-off-by: Rusty Russell

    Rusty Russell
     

30 Dec, 2008

2 commits

  • They're only for use in boot/cpu hotplug code anyway, and this avoids
    the use of deprecated cpu_*_map.

    Stephen Rothwell points out that gcc 4.2.4 (on powerpc at least)
    didn't like the cast away of const anyway:

    include/linux/cpumask.h: In function 'set_cpu_possible':
    include/linux/cpumask.h:1052: warning: passing argument 2 of 'cpumask_set_cpu' discards qualifiers from pointer target type

    So this kills two birds with one stone.

    Signed-off-by: Rusty Russell

    Rusty Russell
     
  • Impact: cleanup

    This implements the obsolescent cpu_online_map in terms of
    cpu_online_mask, rather than the other way around. Same for the other
    maps.

    The documentation comments are also updated to refer to _mask rather
    than _map.

    Signed-off-by: Rusty Russell
    Signed-off-by: Mike Travis

    Rusty Russell
     

13 Dec, 2008

1 commit

  • Impact: cleanup

    Each SMP arch defines these themselves. Move them to a central
    location.

    Twists:
    1) Some archs (m32, parisc, s390) set possible_map to all 1, so we add a
    CONFIG_INIT_ALL_POSSIBLE for this rather than break them.

    2) mips and sparc32 '#define cpu_possible_map phys_cpu_present_map'.
    Those archs simply have phys_cpu_present_map replaced everywhere.

    3) Alpha defined cpu_possible_map to cpu_present_map; this is tricky
    so I just manipulate them both in sync.

    4) IA64, cris and m32r have gratuitous 'extern cpumask_t cpu_possible_map'
    declarations.

    Signed-off-by: Rusty Russell
    Reviewed-by: Grant Grundler
    Tested-by: Tony Luck
    Acked-by: Ingo Molnar
    Cc: Mike Travis
    Cc: ink@jurassic.park.msu.ru
    Cc: rmk@arm.linux.org.uk
    Cc: starvik@axis.com
    Cc: tony.luck@intel.com
    Cc: takata@linux-m32r.org
    Cc: ralf@linux-mips.org
    Cc: grundler@parisc-linux.org
    Cc: paulus@samba.org
    Cc: schwidefsky@de.ibm.com
    Cc: lethal@linux-sh.org
    Cc: wli@holomorphy.com
    Cc: davem@davemloft.net
    Cc: jdike@addtoit.com
    Cc: mingo@redhat.com

    Rusty Russell
     

01 Dec, 2008

1 commit


06 Nov, 2008

1 commit

  • Impact: introduce new APIs

    We want to deprecate cpumasks on the stack, as we are headed for
    gynormous numbers of CPUs. Eventually, we want to head towards an
    undefined 'struct cpumask' so they can never be declared on stack.

    1) New cpumask functions which take pointers instead of copies.
    (cpus_* -> cpumask_*)

    2) Several new helpers to reduce requirements for temporary cpumasks
    (cpumask_first_and, cpumask_next_and, cpumask_any_and)

    3) Helpers for declaring cpumasks on or offstack for large NR_CPUS
    (cpumask_var_t, alloc_cpumask_var and free_cpumask_var)

    4) 'struct cpumask' for explicitness and to mark new-style code.

    5) Make iterator functions stop at nr_cpu_ids (a runtime constant),
    not NR_CPUS for time efficiency and for smaller dynamic allocations
    in future.

    6) cpumask_copy() so we can allocate less than a full cpumask eventually
    (for alloc_cpumask_var), and so we can eliminate the 'struct cpumask'
    definition eventually.

    7) work_on_cpu() helper for doing task on a CPU, rather than saving old
    cpumask for current thread and manipulating it.

    8) smp_call_function_many() which is smp_call_function_mask() except
    taking a cpumask pointer.

    Note that this patch simply introduces the new functions and leaves
    the obsolescent ones in place. This is to simplify the transition
    patches.

    Signed-off-by: Rusty Russell
    Signed-off-by: Ingo Molnar

    Rusty Russell
     

08 Oct, 2008

1 commit


09 Sep, 2008

1 commit

  • Right now, there is no notifier that is called on a new cpu, before the new
    cpu begins processing interrupts/softirqs.
    Various kernel function would need that notification, e.g. kvm works around
    by calling smp_call_function_single(), rcu polls cpu_online_map.

    The patch adds a CPU_STARTING notification. It also adds a helper function
    that sends the message to all cpu_chain handlers.

    Tested on x86-64.
    All other archs are untested. Especially on sparc, I'm not sure if I got
    it right.

    Signed-off-by: Manfred Spraul
    Signed-off-by: Ingo Molnar

    Manfred Spraul
     

07 Sep, 2008

1 commit

  • When a cpu is taken offline, the CPU_DYING notifiers are called on the
    dying cpu. According to , the cpu should be "not
    running any task, not handling interrupts, soon dead".

    For the current implementation, this is not true:
    - __cpu_disable can fail. If it fails, then the cpu will remain alive
    and happy.
    - At least on x86, __cpu_disable() briefly enables the local interrupts
    to handle any outstanding interrupts.

    What about moving CPU_DYING down a few lines, behind the __cpu_disable()
    line?
    There are only two CPU_DYING handlers in the kernel right now: one in
    kvm, one in the scheduler. Both should work with the patch applied
    [and: I'm not sure if either one handles a failing __cpu_disable()]

    The patch survives simple offlining a cpu. kvm untested due to lack
    of a test setup.

    Signed-off-By: Manfred Spraul
    Signed-off-by: Ingo Molnar

    Manfred Spraul
     

13 Aug, 2008

1 commit


11 Aug, 2008

1 commit

  • Mark Langsdorf reported:

    > One of my co-workers noticed that the powernow-k8
    > driver no longer restarts when a CPU core is
    > hot-disabled and then hot-enabled on AMD quad-core
    > systems.
    >
    > The following comands work fine on 2.6.26 and fail
    > on 2.6.27-rc1:
    >
    > echo 0 > /sys/devices/system/cpu/cpu3/online
    > echo 1 > /sys/devices/system/cpu/cpu3/online
    > find /sys -name cpufreq
    >
    > For 2.6.26, the find will return a cpufreq
    > directory for each processor. In 2.6.27-rc1,
    > the cpu3 directory is missing.
    >
    > After digging through the code, the following
    > logic is failing when the core is hot-enabled
    > at runtime. The code works during the boot
    > sequence.
    >
    > cpumask_t = current->cpus_allowed;
    > set_cpus_allowed_ptr(current, &cpumask_of_cpu(cpu));
    > if (smp_processor_id() != cpu)
    > return -ENODEV;

    So set the CPU active before calling the CPU_ONLINE notifier chain,
    there are a handful of notifiers that use set_cpus_allowed().

    This fix also solves the problem with x86-microcode. I've sent
    alternative patches for microcode, but as this "rely on
    set_cpus_allowed_ptr() being workable in cpu-hotplug(CPU_ONLINE, ...)"
    assumption seems to be more broad than what we thought, perhaps this fix
    should be applied.

    With this patch we define that by the moment CPU_ONLINE is being sent,
    a 'cpu' is online and ready for tasks to be migrated onto it.

    Signed-off-by: Dmitry Adamushko
    Reported-by: Mark Langsdorf
    Tested-by: Mark Langsdorf
    Signed-off-by: Ingo Molnar

    Dmitry Adamushko
     

29 Jul, 2008

2 commits

  • Conflicts:

    kernel/stop_machine.c

    Signed-off-by: Ingo Molnar

    Ingo Molnar
     
  • Clean up and optimize cpumask_of_cpu(), by sharing all the zero words.

    Instead of stupidly generating all possible i=0...NR_CPUS 2^i patterns
    creating a huge array of constant bitmasks, realize that the zero words
    can be shared.

    In other words, on a 64-bit architecture, we only ever need 64 of these
    arrays - with a different bit set in one single world (with enough zero
    words around it so that we can create any bitmask by just offsetting in
    that big array). And then we just put enough zeroes around it that we
    can point every single cpumask to be one of those things.

    So when we have 4k CPU's, instead of having 4k arrays (of 4k bits each,
    with one bit set in each array - 2MB memory total), we have exactly 64
    arrays instead, each 8k bits in size (64kB total).

    And then we just point cpumask(n) to the right position (which we can
    calculate dynamically). Once we have the right arrays, getting
    "cpumask(n)" ends up being:

    static inline const cpumask_t *get_cpu_mask(unsigned int cpu)
    {
    const unsigned long *p = cpu_bit_bitmap[1 + cpu % BITS_PER_LONG];
    p -= cpu / BITS_PER_LONG;
    return (const cpumask_t *)p;
    }

    This brings other advantages and simplifications as well:

    - we are not wasting memory that is just filled with a single bit in
    various different places

    - we don't need all those games to re-create the arrays in some dense
    format, because they're already going to be dense enough.

    if we compile a kernel for up to 4k CPU's, "wasting" that 64kB of memory
    is a non-issue (especially since by doing this "overlapping" trick we
    probably get better cache behaviour anyway).

    [ mingo@elte.hu:

    Converted Linus's mails into a commit. See:

    http://lkml.org/lkml/2008/7/27/156
    http://lkml.org/lkml/2008/7/28/320

    Also applied a family filter - which also has the side-effect of leaving
    out the bits where Linus calls me an idio... Oh, never mind ;-)
    ]

    Signed-off-by: Ingo Molnar
    Cc: Rusty Russell
    Cc: Andrew Morton
    Cc: Al Viro
    Cc: Mike Travis
    Signed-off-by: Ingo Molnar

    Linus Torvalds
     

28 Jul, 2008

3 commits

  • Instead of a "cpu" arg with magic values NR_CPUS (any cpu) and ~0 (all
    cpus), pass a cpumask_t. Allow NULL for the common case (where we
    don't care which CPU the function is run on): temporary cpumask_t's
    are usually considered bad for stack space.

    This deprecates stop_machine_run, to be removed soon when all the
    callers are dead.

    Signed-off-by: Rusty Russell

    Rusty Russell
     
  • Akinobu points out that if take_cpu_down() succeeds, the cpu must be offline.
    Remove the cpu_online() check, and put a BUG_ON().

    Quoting Akinobu Mita:
    Actually the cpu_online() check was necessary before appling this
    stop_machine: simplify patch.

    With old __stop_machine_run(), __stop_machine_run() could succeed
    (return !IS_ERR(p) value) even if take_cpu_down() returned non-zero value.
    The return value of take_cpu_down() was obtained through kthread_stop()..

    Signed-off-by: Rusty Russell
    Cc: "Akinobu Mita"

    Rusty Russell
     
  • stop_machine creates a kthread which creates kernel threads. We can
    create those threads directly and simplify things a little. Some care
    must be taken with CPU hotunplug, which has special needs, but that code
    seems more robust than it was in the past.

    Signed-off-by: Rusty Russell
    Acked-by: Christian Borntraeger

    Rusty Russell
     

26 Jul, 2008

4 commits

  • fix:

    ERROR: "cpumask_of_cpu_map" [drivers/acpi/processor.ko] undefined!
    ERROR: "cpumask_of_cpu_map" [arch/x86/kernel/microcode.ko] undefined!
    ERROR: "cpumask_of_cpu_map" [arch/x86/kernel/cpu/cpufreq/speedstep-ich.ko] undefined!
    ERROR: "cpumask_of_cpu_map" [arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.ko] undefined!

    Signed-off-by: Ingo Molnar

    Ingo Molnar
     
  • * Create the cpumask_of_cpu_map statically in the init data section
    using NR_CPUS but replace it during boot up with one sized by
    nr_cpu_ids (num possible cpus).

    Signed-off-by: Mike Travis
    Cc: Andrew Morton
    Cc: Jack Steiner
    Cc: Rusty Russell
    Signed-off-by: Ingo Molnar

    Mike Travis
     
  • If an arch doesn't define cpumask_of_cpu_map, create a generic
    statically-initialized one for them. This allows removal of the buggy
    cpumask_of_cpu() macro (&cpumask_of_cpu() gives address of
    out-of-scope var).

    An arch with NR_CPUS of 4096 probably wants to allocate this itself
    based on the actual number of CPUs, since otherwise they're using 2MB
    of rodata (1024 cpus means 128k). That's what
    CONFIG_HAVE_CPUMASK_OF_CPU_MAP is for (only x86/64 does so at the
    moment).

    In future as we support more CPUs, we'll need to resort to a
    get_cpu_map()/put_cpu_map() allocation scheme.

    Signed-off-by: Mike Travis
    Signed-off-by: Rusty Russell
    Cc: Andrew Morton
    Cc: Jack Steiner
    Signed-off-by: Ingo Molnar

    Mike Travis
     
  • workqueue_cpu_callback(CPU_DEAD) flushes cwq->thread under
    cpu_maps_update_begin(). This means that the multithreaded workqueues
    can't use get_online_cpus() due to the possible deadlock, very bad and
    very old problem.

    Introduce the new state, CPU_POST_DEAD, which is called after
    cpu_hotplug_done() but before cpu_maps_update_done().

    Change workqueue_cpu_callback() to use CPU_POST_DEAD instead of CPU_DEAD.
    This means that create/destroy functions can't rely on get_online_cpus()
    any longer and should take cpu_add_remove_lock instead.

    [akpm@linux-foundation.org: fix CONFIG_SMP=n]
    Signed-off-by: Oleg Nesterov
    Acked-by: Gautham R Shenoy
    Cc: Heiko Carstens
    Cc: Max Krasnyansky
    Cc: Paul Jackson
    Cc: Paul Menage
    Cc: Peter Zijlstra
    Cc: Vegard Nossum
    Cc: Martin Schwidefsky
    Cc: Ingo Molnar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Oleg Nesterov
     

24 Jul, 2008

1 commit

  • * 'sched/for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    sched: hrtick_enabled() should use cpu_active()
    sched, x86: clean up hrtick implementation
    sched: fix build error, provide partition_sched_domains() unconditionally
    sched: fix warning in inc_rt_tasks() to not declare variable 'rq' if it's not needed
    cpu hotplug: Make cpu_active_map synchronization dependency clear
    cpu hotplug, sched: Introduce cpu_active_map and redo sched domain managment (take 2)
    sched: rework of "prioritize non-migratable tasks over migratable ones"
    sched: reduce stack size in isolated_cpu_setup()
    Revert parts of "ftrace: do not trace scheduler functions"

    Fixed up conflicts in include/asm-x86/thread_info.h (due to the
    TIF_SINGLESTEP unification vs TIF_HRTICK_RESCHED removal) and
    kernel/sched_fair.c (due to cpu_active_map vs for_each_cpu_mask_nr()
    introduction).

    Linus Torvalds
     

19 Jul, 2008

1 commit


18 Jul, 2008

2 commits

  • This goes on top of the cpu_active_map (take 2) patch.

    Currently we depend on the stop_machine to provide nescessesary
    synchronization for the cpu_active_map updates.
    As Dmitry Adamushko pointed this is fragile and is not much clearer
    than the previous scheme. In other words we do not want to depend on
    the internal stop machine operation here.
    So make the synchronization rules clear by doing synchronize_sched()
    after clearing out cpu active bit.

    Tested on quad-Core2 with:

    while true; do
    for i in 1 2 3; do
    echo 0 > /sys/devices/system/cpu/cpu$i/online
    done
    for i in 1 2 3; do
    echo 1 > /sys/devices/system/cpu/cpu$i/online
    done
    done
    and
    stress -c 200

    No lockdep, preempt or other complaints.

    Signed-off-by: Max Krasnyansky
    Acked-by: Peter Zijlstra
    Signed-off-by: Ingo Molnar

    Max Krasnyansky
     
  • This is based on Linus' idea of creating cpu_active_map that prevents
    scheduler load balancer from migrating tasks to the cpu that is going
    down.

    It allows us to simplify domain management code and avoid unecessary
    domain rebuilds during cpu hotplug event handling.

    Please ignore the cpusets part for now. It needs some more work in order
    to avoid crazy lock nesting. Although I did simplfy and unify domain
    reinitialization logic. We now simply call partition_sched_domains() in
    all the cases. This means that we're using exact same code paths as in
    cpusets case and hence the test below cover cpusets too.
    Cpuset changes to make rebuild_sched_domains() callable from various
    contexts are in the separate patch (right next after this one).

    This not only boots but also easily handles
    while true; do make clean; make -j 8; done
    and
    while true; do on-off-cpu 1; done
    at the same time.
    (on-off-cpu 1 simple does echo 0/1 > /sys/.../cpu1/online thing).

    Suprisingly the box (dual-core Core2) is quite usable. In fact I'm typing
    this on right now in gnome-terminal and things are moving just fine.

    Also this is running with most of the debug features enabled (lockdep,
    mutex, etc) no BUG_ONs or lockdep complaints so far.

    I believe I addressed all of the Dmitry's comments for original Linus'
    version. I changed both fair and rt balancer to mask out non-active cpus.
    And replaced cpu_is_offline() with !cpu_active() in the main scheduler
    code where it made sense (to me).

    Signed-off-by: Max Krasnyanskiy
    Acked-by: Linus Torvalds
    Acked-by: Peter Zijlstra
    Acked-by: Gregory Haskins
    Cc: dmitry.adamushko@gmail.com
    Cc: pj@sgi.com
    Signed-off-by: Ingo Molnar

    Max Krasnyansky
     

17 Jul, 2008

1 commit

  • The ACPI device node for the cpu has already been unregistered
    when acpi_processor_handle_eject is called.
    Thus we should offline the cpu and continue, rather than a failure here.
    http://bugzilla.kernel.org/show_bug.cgi?id=9772

    Signed-off-by: Zhang Rui
    Signed-off-by: Len Brown
    Signed-off-by: Andi Kleen

    Zhang Rui
     

16 Jul, 2008

1 commit


06 Jun, 2008

1 commit

  • kernel/cpu.c seems a more logical place for those maps since they do not really
    have much to do with the scheduler these days.

    kernel/cpu.c is now built for the UP kernel too, but it does not affect the size
    the kernel sections.

    $ size vmlinux

    before
    text data bss dec hex filename
    3313797 307060 310352 3931209 3bfc49 vmlinux

    after
    text data bss dec hex filename
    3313797 307060 310352 3931209 3bfc49 vmlinux

    Signed-off-by: Max Krasnyansky
    Cc: pj@sgi.com
    Cc: menage@google.com
    Cc: rostedt@goodmis.org
    Cc: mingo@elte.hu
    Acked-by: Peter Zijlstra
    Signed-off-by: Thomas Gleixner

    Max Krasnyansky
     

24 May, 2008

1 commit


30 Apr, 2008

1 commit


29 Apr, 2008

4 commits

  • cpu_hotplug_begin() must be always called under cpu_add_remove_lock, this
    means that only one process can be cpu_hotplug.active_writer. So we don't
    need the cpu_hotplug.writer_queue, we can wake up the ->active_writer
    directly.

    Also, fix the comment.

    Signed-off-by: Oleg Nesterov
    Cc: Dipankar Sarma
    Acked-by: Gautham R Shenoy
    Cc: Ingo Molnar
    Cc: Srivatsa Vaddagiri
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Oleg Nesterov
     
  • Fix following warnings:
    WARNING: vmlinux.o(.text+0xc60): Section mismatch in reference from the function kvm_init() to the function .cpuinit.text:register_cpu_notifier()
    WARNING: vmlinux.o(.text+0x33869a): Section mismatch in reference from the function xfs_icsb_init_counters() to the function .cpuinit.text:register_cpu_notifier()
    WARNING: vmlinux.o(.text+0x5556a1): Section mismatch in reference from the function acpi_processor_install_hotplug_notify() to the function .cpuinit.text:register_cpu_notifier()
    WARNING: vmlinux.o(.text+0xfe6b28): Section mismatch in reference from the function cpufreq_register_driver() to the function .cpuinit.text:register_cpu_notifier()

    register_cpu_notifier() are only really defined when HOTPLUG_CPU is enabled.
    So references to the function are OK.

    Annotate it with __ref so we do not get warnings from callers and do not get
    warnings for the functions/data used by register_cpu_notifier().

    Signed-off-by: Sam Ravnborg
    Cc: Gautham R Shenoy
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Sam Ravnborg
     
  • Fix following warnings:
    WARNING: vmlinux.o(.text+0x75c8d): Section mismatch in reference from the function take_cpu_down() to the variable .cpuinit.data:cpu_chain
    WARNING: vmlinux.o(.text+0x75d2a): Section mismatch in reference from the function _cpu_down() to the variable .cpuinit.data:cpu_chain
    WARNING: vmlinux.o(.text+0x75d4d): Section mismatch in reference from the function _cpu_down() to the variable .cpuinit.data:cpu_chain
    WARNING: vmlinux.o(.text+0x75de4): Section mismatch in reference from the function _cpu_down() to the variable .cpuinit.data:cpu_chain
    WARNING: vmlinux.o(.text+0x75e33): Section mismatch in reference from the function _cpu_down() to the variable .cpuinit.data:cpu_chain

    cpu_down is only used from code surrounded by HOTPLUG_CPU so any references to
    __cpuinit is OK.

    Add a few __ref to tech modpost to ignore the references.

    This is just papering over the fact that the cpu hotplug code is fragile with
    respect to use of HOTPLUG_CPU and in many cases rely on __cpuinit to get rid
    of code when HOTPLUG_CPU is not enabled. For now this is the least invasive
    change.

    Signed-off-by: Sam Ravnborg
    Cc: Gautham R Shenoy
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Sam Ravnborg
     
  • Fix following warning:
    WARNING: vmlinux.o(.text+0x75f4e): Section mismatch in reference from the function unregister_cpu_notifier() to the variable .cpuinit.data:cpu_chain

    We know that unregister_cpu_notifier is using HOTPLUG_CPU
    stuff - so ignore these references.
    Annotating unregister_cpu_notifier had been another option
    but this caused far more warnings since not all callers were
    annotated __cpuinit.

    Signed-off-by: Sam Ravnborg
    Cc: Gautham R Shenoy
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Sam Ravnborg
     

20 Apr, 2008

1 commit

  • * Use new set_cpus_allowed_ptr() function added by previous patch,
    which instead of passing the "newly allowed cpus" cpumask_t arg
    by value, pass it by pointer:

    -int set_cpus_allowed(struct task_struct *p, cpumask_t new_mask)
    +int set_cpus_allowed_ptr(struct task_struct *p, const cpumask_t *new_mask)

    * Modify CPU_MASK_ALL

    Depends on:
    [sched-devel]: sched: add new set_cpus_allowed_ptr function

    Signed-off-by: Mike Travis
    Signed-off-by: Ingo Molnar

    Mike Travis
     

09 Feb, 2008

1 commit

  • Fix following warning:
    WARNING: o-x86_64/kernel/built-in.o(.text+0x36d8b): Section mismatch in reference from the function enable_nonboot_cpus() to the function .cpuinit.text:_cpu_up()

    enable_nonboot_cpus() are used solely from CONFIG_CONFIG_PM_SLEEP_SMP=y
    and PM_SLEEP_SMP imply HOTPLUG_CPU therefore the reference
    to _cpu_up() is valid.
    Annotate enable_nonboot_cpus() with __ref to silence modpost.

    Signed-off-by: Sam Ravnborg
    Cc: Gautham R Shenoy
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Sam Ravnborg
     

26 Jan, 2008

2 commits

  • This patch converts the known per-subsystem mutexes to get_online_cpus
    put_online_cpus. It also eliminates the CPU_LOCK_ACQUIRE and
    CPU_LOCK_RELEASE hotplug notification events.

    Signed-off-by: Gautham R Shenoy
    Signed-off-by: Ingo Molnar

    Gautham R Shenoy
     
  • Replace all lock_cpu_hotplug/unlock_cpu_hotplug from the kernel and use
    get_online_cpus and put_online_cpus instead as it highlights the
    refcount semantics in these operations.

    The new API guarantees protection against the cpu-hotplug operation, but
    it doesn't guarantee serialized access to any of the local data
    structures. Hence the changes needs to be reviewed.

    In case of pseries_add_processor/pseries_remove_processor, use
    cpu_maps_update_begin()/cpu_maps_update_done() as we're modifying the
    cpu_present_map there.

    Signed-off-by: Gautham R Shenoy
    Signed-off-by: Ingo Molnar

    Gautham R Shenoy