1. 28 7月, 2008 2 次提交
    • R
      Hotplug CPU: don't check cpu_online after take_cpu_down · 04321587
      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: NRusty Russell <rusty@rustcorp.com.au>
      Cc: "Akinobu Mita" <akinobu.mita@gmail.com>
      04321587
    • R
      Simplify stop_machine · ffdb5976
      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: NRusty Russell <rusty@rustcorp.com.au>
      Acked-by: NChristian Borntraeger <borntraeger@de.ibm.com>
      ffdb5976
  2. 26 7月, 2008 1 次提交
    • O
      workqueues: make get_online_cpus() useable for work->func() · 3da1c84c
      Oleg Nesterov 提交于
      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: NOleg Nesterov <oleg@tv-sign.ru>
      Acked-by: NGautham R Shenoy <ego@in.ibm.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Max Krasnyansky <maxk@qualcomm.com>
      Cc: Paul Jackson <pj@sgi.com>
      Cc: Paul Menage <menage@google.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Vegard Nossum <vegard.nossum@gmail.com>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      3da1c84c
  3. 18 7月, 2008 2 次提交
    • M
      cpu hotplug: Make cpu_active_map synchronization dependency clear · 39b0fad7
      Max Krasnyansky 提交于
      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: NMax Krasnyansky <maxk@qualcomm.com>
      Acked-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      39b0fad7
    • M
      cpu hotplug, sched: Introduce cpu_active_map and redo sched domain managment (take 2) · e761b772
      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: NMax Krasnyanskiy <maxk@qualcomm.com>
      Acked-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Acked-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
      Acked-by: NGregory Haskins <ghaskins@novell.com>
      Cc: dmitry.adamushko@gmail.com
      Cc: pj@sgi.com
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      e761b772
  4. 17 7月, 2008 1 次提交
  5. 06 6月, 2008 1 次提交
  6. 24 5月, 2008 1 次提交
  7. 30 4月, 2008 1 次提交
  8. 29 4月, 2008 4 次提交
    • O
      simplify cpu_hotplug_begin()/put_online_cpus() · d2ba7e2a
      Oleg Nesterov 提交于
      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: NOleg Nesterov <oleg@tv-sign.ru>
      Cc: Dipankar Sarma <dipankar@in.ibm.com>
      Acked-by: NGautham R Shenoy <ego@in.ibm.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Srivatsa Vaddagiri <vatsa@in.ibm.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      d2ba7e2a
    • S
      cpu: fix section mismatch warning in reference to register_cpu_notifier · f7b16c10
      Sam Ravnborg 提交于
      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: NSam Ravnborg <sam@ravnborg.org>
      Cc: Gautham R Shenoy <ego@in.ibm.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      f7b16c10
    • S
      cpu: fix section mismatch warnings in *cpu_down · 514a20a5
      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: NSam Ravnborg <sam@ravnborg.org>
      Cc: Gautham R Shenoy <ego@in.ibm.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      514a20a5
    • S
      cpu: fix section mismatch warning in unregister_cpu_notifier · 9647155f
      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: NSam Ravnborg <sam@ravnborg.org>
      Cc: Gautham R Shenoy <ego@in.ibm.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      9647155f
  9. 20 4月, 2008 1 次提交
    • M
      generic: use new set_cpus_allowed_ptr function · f70316da
      Mike Travis 提交于
        * 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: NMike Travis <travis@sgi.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      f70316da
  10. 09 2月, 2008 1 次提交
  11. 26 1月, 2008 3 次提交
  12. 20 10月, 2007 2 次提交
  13. 19 10月, 2007 1 次提交
    • A
      cpu hotplug: cpu: deliver CPU_UP_CANCELED only to NOTIFY_OKed callbacks with CPU_UP_PREPARE · a0d8cdb6
      Akinobu Mita 提交于
      The functions in a CPU notifier chain is called with CPU_UP_PREPARE event
      before making the CPU online.  If one of the callback returns NOTIFY_BAD, it
      stops to deliver CPU_UP_PREPARE event, and CPU online operation is canceled.
      Then CPU_UP_CANCELED event is delivered to the functions in a CPU notifier
      chain again.
      
      This CPU_UP_CANCELED event is delivered to the functions which have been
      called with CPU_UP_PREPARE, not delivered to the functions which haven't been
      called with CPU_UP_PREPARE.
      
      The problem that makes existing cpu hotplug error handlings complex is that
      the CPU_UP_CANCELED event is delivered to the function that has returned
      NOTIFY_BAD, too.
      
      Usually we don't expect to call destructor function against the object that
      has failed to initialize.  It is like:
      
      	err = register_something();
      	if (err) {
      		unregister_something();
      		return err;
      	}
      
      So it is natural to deliver CPU_UP_CANCELED event only to the functions that
      have returned NOTIFY_OK with CPU_UP_PREPARE event and not to call the function
      that have returned NOTIFY_BAD.  This is what this patch is doing.
      
      Otherwise, every cpu hotplug notifiler has to track whether notifiler event is
      failed or not for each cpu.  (drivers/base/topology.c is doing this with
      topology_dev_map)
      
      Similary this patch makes same thing with CPU_DOWN_PREPARE and CPU_DOWN_FAILED
      evnets.
      Acked-by: NRusty Russell <rusty@rustcorp.com.au>
      Signed-off-by: NAkinobu Mita <akinobu.mita@gmail.com>
      Cc: Gautham R Shenoy <ego@in.ibm.com>
      Cc: Oleg Nesterov <oleg@tv-sign.ru>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      a0d8cdb6
  14. 31 8月, 2007 1 次提交
  15. 16 7月, 2007 1 次提交
    • A
      HOTPLUG: Add CPU_DYING notifier · db912f96
      Avi Kivity 提交于
      KVM wants a notification when a cpu is about to die, so it can disable
      hardware extensions, but at a time when user processes cannot be scheduled
      on the cpu, so it doesn't try to use virtualization extensions after they
      have been disabled.
      
      This adds a CPU_DYING notification.  The notification is called in atomic
      context on the doomed cpu.
      Signed-off-by: NAvi Kivity <avi@qumranet.com>
      db912f96
  16. 10 5月, 2007 5 次提交
    • R
      microcode: use suspend-related CPU hotplug notifications · 455c017a
      Rafael J. Wysocki 提交于
      Make the microcode driver use the suspend-related CPU hotplug notifications
      to handle the CPU hotplug events occuring during system-wide suspend and
      resume transitions.  Remove the global variable suspend_cpu_hotplug
      previously used for this purpose.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Cc: Gautham R Shenoy <ego@in.ibm.com>
      Cc: Pavel Machek <pavel@ucw.cz>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      455c017a
    • R
      Add suspend-related notifications for CPU hotplug · 8bb78442
      Rafael J. Wysocki 提交于
      Since nonboot CPUs are now disabled after tasks and devices have been
      frozen and the CPU hotplug infrastructure is used for this purpose, we need
      special CPU hotplug notifications that will help the CPU-hotplug-aware
      subsystems distinguish normal CPU hotplug events from CPU hotplug events
      related to a system-wide suspend or resume operation in progress.  This
      patch introduces such notifications and causes them to be used during
      suspend and resume transitions.  It also changes all of the
      CPU-hotplug-aware subsystems to take these notifications into consideration
      (for now they are handled in the same way as the corresponding "normal"
      ones).
      
      [oleg@tv-sign.ru: cleanups]
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Cc: Gautham R Shenoy <ego@in.ibm.com>
      Cc: Pavel Machek <pavel@ucw.cz>
      Signed-off-by: NOleg Nesterov <oleg@tv-sign.ru>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      8bb78442
    • G
      Remove kthread_bind() call from _cpu_down() · 7b0834c2
      Gautham R Shenoy 提交于
      We are anyway kthread_stop()ping other per-cpu kernel threads after
      move_task_off_dead_cpu(), so we can do it with the stop_machine_run thread
      as well.
      
      I just checked with Vatsa if there was any subtle reason why they
      had put in the kthread_bind() in cpu.c. Vatsa cannot seem to recollect
      any and I can't see any. So let us just remove the kthread_bind.
      Signed-off-by: NGautham R Shenoy <ego@in.ibm.com>
      Cc: Oleg Nesterov <oleg@tv-sign.ru>
      Cc: "Eric W. Biederman" <ebiederm@xmission.com>
      Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      7b0834c2
    • H
      call cpu_chain with CPU_DOWN_FAILED if CPU_DOWN_PREPARE failed · e7407dcc
      Heiko Carstens 提交于
      This makes cpu hotplug symmetrical: if CPU_UP_PREPARE fails we get
      CPU_UP_CANCELED, so we can undo what ever happened on PREPARE.  The same
      should happen for CPU_DOWN_PREPARE.
      
      [akpm@linux-foundation.org: fix for reduce-size-of-task_struct-on-64-bit-machines]
      Cc: Srivatsa Vaddagiri <vatsa@in.ibm.com>
      Cc: Gautham Shenoy <ego@in.ibm.com>
      Signed-off-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Oleg Nesterov <oleg@tv-sign.ru>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      e7407dcc
    • G
      Define and use new events,CPU_LOCK_ACQUIRE and CPU_LOCK_RELEASE · baaca49f
      Gautham R Shenoy 提交于
      This is an attempt to provide an alternate mechanism for postponing
      a hotplug event instead of using a global mechanism like lock_cpu_hotplug.
      
      The proposal is to add two new events namely CPU_LOCK_ACQUIRE and
      CPU_LOCK_RELEASE. The notification for these two events would be sent
      out before and after a cpu_hotplug event respectively.
      
      During the CPU_LOCK_ACQUIRE event, a cpu-hotplug-aware subsystem is
      supposed to acquire any per-subsystem hotcpu mutex ( Eg. workqueue_mutex
      in kernel/workqueue.c ).
      
      During the CPU_LOCK_RELEASE release event the cpu-hotplug-aware subsystem
      is supposed to release the per-subsystem hotcpu mutex.
      
      The reasons for defining new events as opposed to reusing the existing events
      like CPU_UP_PREPARE/CPU_UP_FAILED/CPU_ONLINE for locking/unlocking of
      per-subsystem hotcpu mutexes are as follow:
      
      	- CPU_LOCK_ACQUIRE: All hotcpu mutexes are taken before subsystems
      	start handling pre-hotplug events like CPU_UP_PREPARE/CPU_DOWN_PREPARE
      	etc, thus ensuring a clean handling of these events.
      
      	- CPU_LOCK_RELEASE: The hotcpu mutexes will be released only after
      	all subsystems have handled post-hotplug events like CPU_DOWN_FAILED,
      	CPU_DEAD,CPU_ONLINE etc thereby ensuring that there are no subsequent
      	clashes amongst the interdependent subsystems after a cpu hotplugs.
      
      This patch also uses __raw_notifier_call chain in _cpu_up to take care
      of the dependency between the two consequetive calls to
      raw_notifier_call_chain.
      
      [akpm@linux-foundation.org: fix a bug]
      Signed-off-by: NGautham R Shenoy <ego@in.ibm.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      baaca49f
  17. 03 4月, 2007 1 次提交
    • R
      [PATCH] Fix microcode-related suspend problem · 1d64b9cb
      Rafael J. Wysocki 提交于
      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: NRafael J. Wysocki <rjw@sisk.pl>
      Adrian Bunk <bunk@stusta.de>
      Cc: Tigran Aivazian <tigran@aivazian.fsnet.co.uk>
      Cc: Pavel Machek <pavel@ucw.cz>
      Cc: Maxim <maximlevitsky@gmail.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      1d64b9cb
  18. 12 2月, 2007 1 次提交
  19. 12 1月, 2007 1 次提交
    • G
      [PATCH] Change cpu_up and co from __devinit to __cpuinit · b282b6f8
      Gautham R Shenoy 提交于
      Compiling the kernel with CONFIG_HOTPLUG = y and CONFIG_HOTPLUG_CPU = n
      with CONFIG_RELOCATABLE = y generates the following modpost warnings
      
      WARNING: vmlinux - Section mismatch: reference to .init.data: from
      .text between '_cpu_up' (at offset 0xc0141b7d) and 'cpu_up'
      WARNING: vmlinux - Section mismatch: reference to .init.data: from
      .text between '_cpu_up' (at offset 0xc0141b9c) and 'cpu_up'
      WARNING: vmlinux - Section mismatch: reference to .init.text:__cpu_up
      from .text between '_cpu_up' (at offset 0xc0141bd8) and 'cpu_up'
      WARNING: vmlinux - Section mismatch: reference to .init.data: from
      .text between '_cpu_up' (at offset 0xc0141c05) and 'cpu_up'
      WARNING: vmlinux - Section mismatch: reference to .init.data: from
      .text between '_cpu_up' (at offset 0xc0141c26) and 'cpu_up'
      WARNING: vmlinux - Section mismatch: reference to .init.data: from
      .text between '_cpu_up' (at offset 0xc0141c37) and 'cpu_up'
      
      This is because cpu_up, _cpu_up and __cpu_up (in some architectures) are
      defined as __devinit
      AND
      __cpu_up calls some __cpuinit functions.
      
      Since __cpuinit would map to __init with this kind of a configuration,
      we get a .text refering .init.data warning.
      
      This patch solves the problem by converting all of __cpu_up, _cpu_up
      and cpu_up from __devinit to __cpuinit. The approach is justified since
      the callers of cpu_up are either dependent on CONFIG_HOTPLUG_CPU or
      are of __init type.
      
      Thus when CONFIG_HOTPLUG_CPU=y, all these cpu up functions would land up
      in .text section, and when CONFIG_HOTPLUG_CPU=n, all these functions would
      land up in .init section.
      
      Tested on a i386 SMP machine running linux-2.6.20-rc3-mm1.
      Signed-off-by: NGautham R Shenoy <ego@in.ibm.com>
      Cc: Vivek Goyal <vgoyal@in.ibm.com>
      Cc: Mikael Starvik <starvik@axis.com>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Kyle McMartin <kyle@mcmartin.ca>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: "David S. Miller" <davem@davemloft.net>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      b282b6f8
  20. 24 12月, 2006 1 次提交
    • I
      [PATCH] suspend: fix suspend on single-CPU systems · e1d9fd2e
      Ingo Molnar 提交于
      Clark Williams reported that suspend doesnt work on his laptop on
      2.6.20-rc1-rt kernels. The bug was introduced by the following cleanup
      commit:
      
       commit 112cecb2
       Author: Siddha, Suresh B <suresh.b.siddha@intel.com>
       Date:   Wed Dec 6 20:34:31 2006 -0800
      
          [PATCH] suspend: don't change cpus_allowed for task initiating the suspend
      
      because with this change 'error' is not initialized to 0 anymore, if
      there are no other online CPUs. (i.e. if the system is single-CPU).
      
      the fix is the initialize it to 0. The really weird thing is that my
      version of gcc does not warn about this non-initialized variable
      situation ...
      
      (also fix the kernel printk in the error branch, it was missing a
       newline)
      Reported-by: NClark Williams <williams@redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      e1d9fd2e
  21. 08 12月, 2006 1 次提交
  22. 06 11月, 2006 1 次提交
  23. 29 10月, 2006 1 次提交
  24. 17 10月, 2006 1 次提交
    • N
      [PATCH] Convert cpu hotplug notifiers to use raw_notifier instead of blocking_notifier · bd5349cf
      Neil Brown 提交于
      The use of blocking notifier by _cpu_up and _cpu_down in cpu.c has two
      problem.
      
      1/ An interaction with the workqueue notifier causes lockdep to spit a
         warning.
      
      2/ A notifier could conceivable be added or removed while _cpu_up or
         _cpu_down are in process.  As each notifier is called twice (prepare
         then commit/abort) this could be unhealthy.
      
      To fix to we simply take cpu_add_remove_lock while adding or removing
      notifiers to/from the list.
      
      This makes the 'blocking' usage unnecessary as all accesses to cpu_chain
      are now protected by cpu_add_remove_lock.  So change "blocking" to "raw" in
      all relevant places.  This fixes 1.
      
      Credit: Andrew Morton
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Cc: Michal Piotrowski <michal.k.k.piotrowski@gmail.com> (reporter)
      Signed-off-by: NNeil Brown <neilb@suse.de>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      bd5349cf
  25. 26 9月, 2006 1 次提交
    • R
      [PATCH] Disable CPU hotplug during suspend · e3920fb4
      Rafael J. Wysocki 提交于
      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: NRafael J. Wysocki <rjw@sisk.pl>
      Acked-by: NPavel Machek <pavel@ucw.cz>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      e3920fb4
  26. 24 7月, 2006 1 次提交
    • L
      cpu hotplug: simplify and hopefully fix locking · aa953877
      Linus Torvalds 提交于
      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: NLinus Torvalds <torvalds@osdl.org>
      aa953877
  27. 28 6月, 2006 1 次提交
  28. 27 6月, 2006 1 次提交