05 Nov, 2011

1 commit


26 Jul, 2011

1 commit

  • We presently define all kinds of notifiers in notifier.h. This is not
    necessary at all, since different subsystems use different notifiers, they
    are almost non-related with each other.

    This can also save much build time. Suppose I add a new netdevice event,
    really I don't have to recompile all the source, just network related.
    Without this patch, all the source will be recompiled.

    I move the notify events near to their subsystem notifier registers, so
    that they can be found more easily.

    This patch:

    It is not necessary to share the same notifier.h.

    Signed-off-by: WANG Cong
    Cc: David Miller
    Cc: "Rafael J. Wysocki"
    Cc: Greg KH
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Amerigo Wang
     

11 Nov, 2010

1 commit


29 Jun, 2010

1 commit

  • Reimplement CPU hotplugging support using trustee thread. On CPU
    down, a trustee thread is created and each step of CPU down is
    executed by the trustee and workqueue_cpu_callback() simply drives and
    waits for trustee state transitions.

    CPU down operation no longer waits for works to be drained but trustee
    sticks around till all pending works have been completed. If CPU is
    brought back up while works are still draining,
    workqueue_cpu_callback() tells trustee to step down and tell workers
    to rebind to the cpu.

    As it's difficult to tell whether cwqs are empty if it's freezing or
    frozen, trustee doesn't consider draining to be complete while a gcwq
    is freezing or frozen (tracked by new GCWQ_FREEZING flag). Also,
    workers which get unbound from their cpu are marked with WORKER_ROGUE.

    Trustee based implementation doesn't bring any new feature at this
    point but it will be used to manage worker pool when dynamic shared
    worker pool is implemented.

    Signed-off-by: Tejun Heo

    Tejun Heo
     

09 Jun, 2010

2 commits

  • Currently, when a cpu goes down, cpu_active is cleared before
    CPU_DOWN_PREPARE starts and cpuset configuration is updated from a
    default priority cpu notifier. When a cpu is coming up, it's set
    before CPU_ONLINE but cpuset configuration again is updated from the
    same cpu notifier.

    For cpu notifiers, this presents an inconsistent state. Threads which
    a CPU_DOWN_PREPARE notifier expects to be bound to the CPU can be
    migrated to other cpus because the cpu is no more inactive.

    Fix it by updating cpu_active in the highest priority cpu notifier and
    cpuset configuration in the second highest when a cpu is coming up.
    Down path is updated similarly. This guarantees that all other cpu
    notifiers see consistent cpu_active and cpuset configuration.

    cpuset_track_online_cpus() notifier is converted to
    cpuset_update_active_cpus() which just updates the configuration and
    now called from cpuset_cpu_[in]active() notifiers registered from
    sched_init_smp(). If cpuset is disabled, cpuset_update_active_cpus()
    degenerates into partition_sched_domains() making separate notifier
    for !CONFIG_CPUSETS unnecessary.

    This problem is triggered by cmwq. During CPU_DOWN_PREPARE, hotplug
    callback creates a kthread and kthread_bind()s it to the target cpu,
    and the thread is expected to run on that cpu.

    * Ingo's test discovered __cpuinit/exit markups were incorrect.
    Fixed.

    Signed-off-by: Tejun Heo
    Acked-by: Peter Zijlstra
    Cc: Rusty Russell
    Cc: Ingo Molnar
    Cc: Paul Menage

    Tejun Heo
     
  • Instead of hardcoding priority 10 and 20 in sched and perf, collect
    them into CPU_PRI_* enums.

    Signed-off-by: Tejun Heo
    Acked-by: Peter Zijlstra
    Cc: Rusty Russell
    Cc: Paul Mackerras
    Cc: Ingo Molnar
    Cc: Arnaldo Carvalho de Melo

    Tejun Heo
     

09 Dec, 2009

2 commits

  • Currently the cpu-allocation/deallocation process comprises of two steps:
    - Set the indicators and to update the device tree with DLPAR node
    information.

    - Online/offline the allocated/deallocated CPU.

    This is achieved by writing to the sysfs tunables "probe" during allocation
    and "release" during deallocation.

    At the sametime, the userspace can independently online/offline the CPUs of
    the system using the sysfs tunable "online".

    It is quite possible that when a userspace tool offlines a CPU
    for the purpose of deallocation and is in the process of updating the device
    tree, some other userspace tool could bring the CPU back online by writing to
    the "online" sysfs tunable thereby causing the deallocate process to fail.

    The solution to this is to serialize writes to the "probe/release" sysfs
    tunable with the writes to the "online" sysfs tunable.

    This patch employs a mutex to provide this serialization, which is a no-op on
    all architectures except PPC_PSERIES

    Signed-off-by: Gautham R Shenoy
    Acked-by: Vaidyanathan Srinivasan
    Signed-off-by: Benjamin Herrenschmidt

    Gautham R Shenoy
     
  • Version 3 of this patch is updated with documentation added to
    Documentation/ABI. There are no changes to any of the C code from v2
    of the patch.

    In order to support kernel DLPAR of CPU resources we need to provide an
    interface to add (probe) and remove (release) the resource from the system.
    This patch Creates new generic probe and release sysfs files to facilitate
    cpu probe/release. The probe/release interface provides for allowing each
    arch to supply their own routines for implementing the backend of adding
    and removing cpus to/from the system.

    This also creates the powerpc specific stubs to handle the arch callouts
    from writes to the sysfs files.

    The creation and use of these files is regulated by the
    CONFIG_ARCH_CPU_PROBE_RELEASE option so that only architectures that need the
    capability will have the files created.

    Signed-off-by: Nathan Fontenot
    Signed-off-by: Benjamin Herrenschmidt

    Nathan Fontenot
     

16 Aug, 2009

1 commit

  • This patch introduces a new cpu_notifier() API that is similar
    to hotcpu_notifier(), but which also notifies of CPUs coming
    online during boot in the !HOTPLUG_CPU case.

    Reported-by: Ingo Molnar
    Reported-by: Hugh Dickins
    Tested-by: Hugh Dickins
    Signed-off-by: Paul E. McKenney
    Cc: laijs@cn.fujitsu.com
    Cc: dipankar@in.ibm.com
    Cc: josht@linux.vnet.ibm.com
    Cc: akpm@linux-foundation.org
    Cc: mathieu.desnoyers@polymtl.ca
    Cc: dvhltc@us.ibm.com
    Cc: niv@us.ibm.com
    Cc: peterz@infradead.org
    Cc: rostedt@goodmis.org
    Cc: benh@kernel.crashing.org
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Paul E. McKenney
     

23 Jun, 2009

1 commit

  • SLAB uses get/put_online_cpus() which use a mutex which is itself only
    initialized when cpu_hotplug_init() is called. Currently we hang suring
    boot in SLAB due to doing that too late.

    Reported by James Bottomley and Sachin Sant (and possibly others).
    Debugged by Benjamin Herrenschmidt.

    This just removes the dynamic initialization of the data structures, and
    replaces it with a static one, avoiding this dependency entirely, and
    removing one unnecessary special initcall.

    Tested-by: Sachin Sant
    Tested-by: James Bottomley
    Tested-by: Benjamin Herrenschmidt
    Signed-off-by: Linus Torvalds

    Linus Torvalds
     

03 Apr, 2009

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
     

26 Jul, 2008

1 commit

  • 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
     

29 Apr, 2008

1 commit

  • Fix following warnings:
    WARNING: vmlinux.o(.data+0x5020): Section mismatch in reference from the variable cpu_vsyscall_notifier_nb.12876 to the function .cpuinit.text:cpu_vsyscall_notifier()
    WARNING: vmlinux.o(.data+0x9ce0): Section mismatch in reference from the variable profile_cpu_callback_nb.17654 to the function .devinit.text:profile_cpu_callback()
    WARNING: vmlinux.o(.data+0xd380): Section mismatch in reference from the variable workqueue_cpu_callback_nb.15004 to the function .devinit.text:workqueue_cpu_callback()
    WARNING: vmlinux.o(.data+0x11d00): Section mismatch in reference from the variable relay_hotcpu_callback_nb.19626 to the function .cpuinit.text:relay_hotcpu_callback()
    WARNING: vmlinux.o(.data+0x12970): Section mismatch in reference from the variable cpu_callback_nb.24694 to the function .devinit.text:cpu_callback()
    WARNING: vmlinux.o(.data+0x3fee0): Section mismatch in reference from the variable percpu_counter_hotcpu_callback_nb.10903 to the function .cpuinit.text:percpu_counter_hotcpu_callback()
    WARNING: vmlinux.o(.data+0x74ce0): Section mismatch in reference from the variable topology_cpu_callback_nb.12506 to the function .cpuinit.text:topology_cpu_callback()

    Functions used as argument are by definition only used in HOTPLUG_CPU
    situations so thay are annotated __cpuinit. Annotate the static variable used
    by hotcpu_register with __cpuinitdata to match this definition.

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

    Sam Ravnborg
     

19 Apr, 2008

1 commit


26 Jan, 2008

3 commits

  • fix build on !CONFIG_SMP.

    Signed-off-by: Ingo Molnar

    Ingo Molnar
     
  • 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
     
  • This patch implements a Refcount + Waitqueue based model for
    cpu-hotplug.

    Now, a thread which wants to prevent cpu-hotplug, will bump up a global
    refcount and the thread which wants to perform a cpu-hotplug operation
    will block till the global refcount goes to zero.

    The readers, if any, during an ongoing cpu-hotplug operation are blocked
    until the cpu-hotplug operation is over.

    Signed-off-by: Gautham R Shenoy
    Signed-off-by: Paul Jackson [For !CONFIG_HOTPLUG_CPU ]
    Signed-off-by: Ingo Molnar

    Gautham R Shenoy
     

07 Jan, 2008

1 commit

  • make randconfig bootup testing found that the cpufreq code
    crashes on bootup, if the powernow-k8 driver is enabled and
    if maxcpus=1 passed on the boot line to a !CONFIG_HOTPLUG_CPU
    kernel.

    First lockdep found out that there's an inconsistent unlock
    sequence:

    =====================================
    [ BUG: bad unlock balance detected! ]
    -------------------------------------
    swapper/1 is trying to release lock (&per_cpu(cpu_policy_rwsem, cpu)) at:
    [] unlock_policy_rwsem_write+0x3c/0x42
    but there are no more locks to release!

    Call Trace:
    [] unlock_policy_rwsem_write+0x3c/0x42
    [] print_unlock_inbalance_bug+0x104/0x12c
    [] mark_held_locks+0x56/0x94
    [] unlock_policy_rwsem_write+0x3c/0x42
    [] cpufreq_add_dev+0x2a8/0x5c4
    ...

    then shortly afterwards the cpufreq code crashed on an assert:

    ------------[ cut here ]------------
    kernel BUG at drivers/cpufreq/cpufreq.c:1068!
    invalid opcode: 0000 [1] SMP
    [...]
    Call Trace:
    [] sysdev_driver_unregister+0x5b/0x91
    [] cpufreq_register_driver+0x15d/0x1a2
    [] powernowk8_init+0x86/0x94
    [...]
    ---[ end trace 1e9219be2b4431de ]---

    the bug was caused by maxcpus=1 bootup, which brought up the
    secondary core as !cpu_online() but !cpu_is_offline() either,
    which on on !CONFIG_HOTPLUG_CPU is always 0 (include/linux/cpu.h):

    /* CPUs don't go offline once they're online w/o CONFIG_HOTPLUG_CPU */
    static inline int cpu_is_offline(int cpu) { return 0; }

    but the cpufreq code uses cpu_online() and cpu_is_offline() in
    a mixed way - the low-level drivers use cpu_online(), while
    the cpufreq core uses cpu_is_offline(). This opened up the
    possibility to add the non-initialized sysdev device of the
    secondary core:

    cpufreq-core: trying to register driver powernow-k8
    cpufreq-core: adding CPU 0
    powernow-k8: BIOS error - no PSB or ACPI _PSS objects
    cpufreq-core: initialization failed
    cpufreq-core: adding CPU 1
    cpufreq-core: initialization failed

    which then blew up. The fix is to make cpu_is_offline() always
    the negation of cpu_online(). With that fix applied the kernel
    boots up fine without crashing:

    Calling initcall 0xffffffff80cc0510: powernowk8_init+0x0/0x94()
    powernow-k8: Found 1 AMD Athlon(tm) 64 X2 Dual Core Processor 3800+ processors (1 cpu cores) (version 2.20.00)
    powernow-k8: BIOS error - no PSB or ACPI _PSS objects
    initcall 0xffffffff80cc0510: powernowk8_init+0x0/0x94() returned -19.
    initcall 0xffffffff80cc0510 ran for 19 msecs: powernowk8_init+0x0/0x94()
    Calling initcall 0xffffffff80cc328f: init_lapic_nmi_sysfs+0x0/0x39()

    We could fix this by making CPU enumeration aware of max_cpus, but that
    would be more fragile IMO, and the cpu_online(cpu) != cpu_is_offline(cpu)
    possibility was quite confusing and a continuous source of bugs too.

    Most distributions have kernels with CPU hotplug enabled, so this bug
    remained hidden for a long time.

    Bug forensics:

    The broken cpu_is_offline() API variant was introduced via:

    commit a59d2e4e6977e7b94e003c96a41f07e96cddc340
    Author: Rusty Russell
    Date: Mon Mar 8 06:06:03 2004 -0800

    [PATCH] minor cleanups for hotplug CPUs

    ( this predates linux-2.6.git, this commit is available from Thomas's
    historic git tree. )

    Then 1.5 years later the cpufreq code made use of it:

    commit c32b6b8e524d2c337767d312814484d9289550cf
    Author: Ashok Raj
    Date: Sun Oct 30 14:59:54 2005 -0800

    [PATCH] create and destroy cpufreq sysfs entries based on cpu notifiers

    + if (cpu_is_offline(cpu))
    + return 0;

    which is a correct use of the subtly broken new API. v2.6.15 then
    shipped with this bug included.

    then it took two more years for random-kernel qa to hit it.

    Signed-off-by: Thomas Gleixner
    Signed-off-by: Ingo Molnar
    Signed-off-by: Linus Torvalds

    Ingo Molnar
     

19 Oct, 2007

1 commit

  • The return of the present "do {} while" based stub definition of
    register_hotcpu_notifier() cannot be checked. This makes the stub
    asymmetric w.r.t. the real HOTPLUG_CPU=y implementation that is
    int-returning. So let us redefine this to be consistent with the full
    version. Also do the same for unregister_hotcpu_notifier().

    We cannot define these as static inline functions due to an existing GCC
    bug (#33172). So define as macros that return appropriately instead (int
    '0' for the register_hotcpu_notifier case and void for
    unregister_hotcpu_notifier).

    Signed-off-by: Satyam Sharma
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Satyam Sharma
     

31 Aug, 2007

1 commit

  • Dependencies of CONFIG_SUSPEND and CONFIG_HIBERNATION introduced by commit
    296699de6bdc717189a331ab6bbe90e05c94db06 "Introduce CONFIG_SUSPEND for
    suspend-to-Ram and standby" are incorrect, as they don't cover the facts that
    (1) not all architectures support suspend and (2) SMP hibernation is only
    possible on X86 and PPC64 (if CONFIG_PPC64_SWSUSP is set).

    Signed-off-by: Rafael J. Wysocki
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rafael J. Wysocki
     

13 Aug, 2007

1 commit

  • This patch makes the following needlessly global code static:

    - arch_reinit_sched_domains()
    - struct attr_sched_mc_power_savings
    - struct attr_sched_smt_power_savings

    Signed-off-by: Adrian Bunk
    Signed-off-by: Andrew Morton
    Signed-off-by: Ingo Molnar

    Adrian Bunk
     

17 Jul, 2007

1 commit


09 May, 2007

1 commit


03 Apr, 2007

1 commit

  • Fix the regression resulting from the recent change of suspend code
    ordering that causes systems based on Intel x86 CPUs using the microcode
    driver to hang during the resume.

    The problem occurs since the microcode driver uses request_firmware() in
    its CPU hotplug notifier, which is called after tasks has been frozen and
    hangs. It can be fixed by telling the microcode driver to use the
    microcode stored in memory during the resume instead of trying to load it
    from disk.

    Signed-off-by: Rafael J. Wysocki
    Adrian Bunk
    Cc: Tigran Aivazian
    Cc: Pavel Machek
    Cc: Maxim
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rafael J. Wysocki
     

13 Feb, 2007

1 commit

  • The following patchset allows a host with running virtual machines to be
    suspended and, on at least a subset of the machines tested, resumed. Note
    that this is orthogonal to suspending and resuming an individual guest to a
    file.

    A side effect of implementing suspend/resume is that cpu hotplug is now
    supported. This should please the owners of big iron.

    This patch:

    KVM wants the cpu hotplug notifications, both for cpu hotplug itself, but more
    commonly for host suspend/resume.

    In order to avoid extensive #ifdefs, provide stubs when CONFIG_CPU_HOTPLUG is
    not defined.

    In all, we have four cases:

    - UP: register and unregister stubbed out
    - SMP+hotplug: full register and unregister
    - SMP, no hotplug, core: register as __init, unregister stubbed
    (cpus are brought up during core initialization)
    - SMP, no hotplug, module: register and unregister stubbed out
    (cpus cannot be brought up during module lifetime)

    Signed-off-by: Avi Kivity
    Cc: Ingo Molnar
    Cc: Rusty Russell
    Cc: Oleg Nesterov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Avi Kivity
     

08 Dec, 2006

3 commits

  • * 'for-linus' of git://one.firstfloor.org/home/andi/git/linux-2.6: (156 commits)
    [PATCH] x86-64: Export smp_call_function_single
    [PATCH] i386: Clean up smp_tune_scheduling()
    [PATCH] unwinder: move .eh_frame to RODATA
    [PATCH] unwinder: fully support linker generated .eh_frame_hdr section
    [PATCH] x86-64: don't use set_irq_regs()
    [PATCH] x86-64: check vector in setup_ioapic_dest to verify if need setup_IO_APIC_irq
    [PATCH] x86-64: Make ix86 default to HIGHMEM4G instead of NOHIGHMEM
    [PATCH] i386: replace kmalloc+memset with kzalloc
    [PATCH] x86-64: remove remaining pc98 code
    [PATCH] x86-64: remove unused variable
    [PATCH] x86-64: Fix constraints in atomic_add_return()
    [PATCH] x86-64: fix asm constraints in i386 atomic_add_return
    [PATCH] x86-64: Correct documentation for bzImage protocol v2.05
    [PATCH] x86-64: replace kmalloc+memset with kzalloc in MTRR code
    [PATCH] x86-64: Fix numaq build error
    [PATCH] x86-64: include/asm-x86_64/cpufeature.h isn't a userspace header
    [PATCH] unwinder: Add debugging output to the Dwarf2 unwinder
    [PATCH] x86-64: Clarify error message in GART code
    [PATCH] x86-64: Fix interrupt race in idle callback (3rd try)
    [PATCH] x86-64: Remove unwind stack pointer alignment forcing again
    ...

    Fixed conflict in include/linux/uaccess.h manually

    Signed-off-by: Linus Torvalds

    Linus Torvalds
     
  • Provide a common interface for all the subsystems to lock and unlock their
    per-subsystem hotcpu mutexes.

    When CONFIG_HOTPLUG_CPU is not set, these operations would be no-ops.

    [akpm@osdl.org: macros -> inlines]
    Signed-off-by: Gautham R Shenoy
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Gautham R Shenoy
     
  • There was lots of #ifdef noise in the kernel due to hotcpu_notifier(fn,
    prio) not correctly marking 'fn' as used in the !HOTPLUG_CPU case, and thus
    generating compiler warnings of unused symbols, hence forcing people to add
    #ifdefs.

    the compiler can skip truly unused functions just fine:

    text data bss dec hex filename
    1624412 728710 3674856 6027978 5bfaca vmlinux.before
    1624412 728710 3674856 6027978 5bfaca vmlinux.after

    [akpm@osdl.org: topology.c fix]
    Signed-off-by: Ingo Molnar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ingo Molnar
     

07 Dec, 2006

1 commit


25 Oct, 2006

1 commit

  • This patch adds two functions to create and remove sysfs attributes and
    attribute_group to all cpus. That allows to register sysfs attributes in
    a subdirectory like: /sys/devices/system/cpu/cpuX/group_name/what_ever
    This will be used by cbe_thermal to group all attributes dealing with
    thermal support in one directory.

    Signed-of-by: Christian Krafft

    Signed-off-by: Paul Mackerras

    Christian Krafft
     

26 Sep, 2006

1 commit

  • The current suspend code has to be run on one CPU, so we use the CPU
    hotplug to take the non-boot CPUs offline on SMP machines. However, we
    should also make sure that these CPUs will not be enabled by someone else
    after we have disabled them.

    The functions disable_nonboot_cpus() and enable_nonboot_cpus() are moved to
    kernel/cpu.c, because they now refer to some stuff in there that should
    better be static. Also it's better if disable_nonboot_cpus() returns an
    error instead of panicking if something goes wrong, and
    enable_nonboot_cpus() has no reason to panic(), because the CPUs may have
    been enabled by the userland before it tries to take them online.

    Signed-off-by: Rafael J. Wysocki
    Acked-by: Pavel Machek
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rafael J. Wysocki
     

24 Jul, 2006

1 commit

  • The CPU hotplug locking was quite messy, with a recursive lock to
    handle the fact that both the actual up/down sequence wanted to
    protect itself from being re-entered, but the callbacks that it
    called also tended to want to protect themselves from CPU events.

    This splits the lock into two (one to serialize the whole hotplug
    sequence, the other to protect against the CPU present bitmaps
    changing). The latter still allows recursive usage because some
    subsystems (ondemand policy for cpufreq at least) had already gotten
    too used to the lax locking, but the locking mistakes are hopefully
    now less fundamental, and we now warn about recursive lock usage
    when we see it, in the hope that it can be fixed.

    Signed-off-by: Linus Torvalds

    Linus Torvalds
     

02 Jul, 2006

1 commit


28 Jun, 2006

3 commits

  • Define new macros register_hotcpu_notifier() and unregister_hotcpu_notifier()
    that redefines register_cpu_notifier() and unregister_cpu_notifier() for use
    only when HOTPLUG_CPU is defined.

    Signed-off-by: Chandra Seetharaman
    Cc: Ashok Raj
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Chandra Seetharaman
     
  • CPUs come online only at init time (unless CONFIG_HOTPLUG_CPU is defined).
    So, cpu_notifier functionality need to be available only at init time.

    This patch makes register_cpu_notifier() available only at init time, unless
    CONFIG_HOTPLUG_CPU is defined.

    This patch exports register_cpu_notifier() and unregister_cpu_notifier() only
    if CONFIG_HOTPLUG_CPU is defined.

    Signed-off-by: Chandra Seetharaman
    Cc: Ashok Raj
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Chandra Seetharaman
     
  • With Goto-san's patch, we can add new pgdat/node at runtime. I'm now
    considering node-hot-add with cpu + memory on ACPI.

    I found acpi container, which describes node, could evaluate cpu before
    memory. This means cpu-hot-add occurs before memory hot add.

    In most part, cpu-hot-add doesn't depend on node hot add. But register_cpu(),
    which creates symbolic link from node to cpu, requires that node should be
    onlined before register_cpu(). When a node is onlined, its pgdat should be
    there.

    This patch-set holds off creating symbolic link from node to cpu
    until node is onlined.

    This removes node arguments from register_cpu().

    Now, register_cpu() requires 'struct node' as its argument. But the array of
    struct node is now unified in driver/base/node.c now (By Goto's node hotplug
    patch). We can get struct node in generic way. So, this argument is not
    necessary now.

    This patch also guarantees add cpu under node only when node is onlined. It
    is necessary for node-hot-add vs. cpu-hot-add patch following this.

    Moreover, register_cpu calculates cpu->node_id by cpu_to_node() without regard
    to its 'struct node *root' argument. This patch removes it.

    Also modify callers of register_cpu()/unregister_cpu, whose args are changed
    by register-cpu-remove-node-struct patch.

    [Brice.Goglin@ens-lyon.org: fix it]
    Signed-off-by: KAMEZAWA Hiroyuki
    Cc: Yasunori Goto
    Cc: Ashok Raj
    Cc: Dave Hansen
    Signed-off-by: Brice Goglin
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    KAMEZAWA Hiroyuki
     

26 Mar, 2006

1 commit

  • - Moved check for online cpu out of smp_prepare_cpu()

    - Moved default declaration of smp_prepare_cpu() to kernel/cpu.c

    - Removed lock_cpu_hotplug() from smp_prepare_cpu() to around it, since
    its called from cpu_up() as well now.

    - Removed clearing from cpu_present_map during cpu_offline as it breaks
    using cpu_up() directly during a subsequent online operation.

    Signed-off-by: Ashok Raj
    Cc: Srivatsa Vaddagiri
    Cc: "Li, Shaohua"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ashok Raj
     

21 Mar, 2006

1 commit


29 Nov, 2005

1 commit

  • There are some callers in cpufreq hotplug notify path that the lowest
    function calls lock_cpu_hotplug(). The lock is already held during
    cpu_up() and cpu_down() calls when the notify calls are broadcast to
    registered clients.

    Ideally if possible, we could disable_preempt() at the highest caller and
    make sure we dont sleep in the path down in cpufreq->driver_target() calls
    but the calls are so intertwined and cumbersome to cleanup.

    Hence we consistently use lock_cpu_hotplug() and unlock_cpu_hotplug() in
    all places.

    - Removed export of cpucontrol semaphore and made it static.
    - removed explicit uses of up/down with lock_cpu_hotplug()
    so we can keep track of the the callers in same thread context and
    just keep refcounts without calling a down() that causes a deadlock.
    - Removed current_in_hotplug() uses
    - Removed PF_HOTPLUG_CPU in sched.h introduced for the current_in_hotplug()
    temporary workaround.

    Tested with insmod of cpufreq_stat.ko, and logical online/offline
    to make sure we dont have any hang situations.

    Signed-off-by: Ashok Raj
    Cc: Zwane Mwaikambo
    Cc: Shaohua Li
    Cc: "Siddha, Suresh B"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ashok Raj