1. 07 3月, 2007 1 次提交
  2. 05 3月, 2007 1 次提交
    • H
      [PATCH] timer/hrtimer: take per cpu locks in sane order · e81ce1f7
      Heiko Carstens 提交于
      Doing something like this on a two cpu system
      
        # echo 0 > /sys/devices/system/cpu/cpu0/online
        # echo 1 > /sys/devices/system/cpu/cpu0/online
        # echo 0 > /sys/devices/system/cpu/cpu1/online
      
      will give me this:
      
        =======================================================
        [ INFO: possible circular locking dependency detected ]
        2.6.21-rc2-g562aa1d4-dirty #7
        -------------------------------------------------------
        bash/1282 is trying to acquire lock:
         (&cpu_base->lock_key){.+..}, at: [<000000000005f17e>] hrtimer_cpu_notify+0xc6/0x240
      
        but task is already holding lock:
         (&cpu_base->lock_key#2){.+..}, at: [<000000000005f174>] hrtimer_cpu_notify+0xbc/0x240
      
        which lock already depends on the new lock.
      
      This happens because we have the following code in kernel/hrtimer.c:
      
        migrate_hrtimers(int cpu)
        [...]
        old_base = &per_cpu(hrtimer_bases, cpu);
        new_base = &get_cpu_var(hrtimer_bases);
        [...]
        spin_lock(&new_base->lock);
        spin_lock(&old_base->lock);
      
      Which means the spinlocks are taken in an order which depends on which cpu
      gets shut down from which other cpu. Therefore lockdep complains that there
      might be an ABBA deadlock. Since migrate_hrtimers() gets only called on
      cpu hotplug it's safe to assume that it isn't executed concurrently on a
      
      The same problem exists in kernel/timer.c: migrate_timers().
      
      As pointed out by Christian Borntraeger one possible solution to avoid
      the locking order complaints would be to make sure that the locks are
      always taken in the same order. E.g. by taking the lock of the cpu with
      the lower number first.
      
      To achieve this we introduce two new spinlock functions double_spin_lock
      and double_spin_unlock which lock or unlock two locks in a given order.
      
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Roman Zippel <zippel@linux-m68k.org>
      Cc: John Stultz <johnstul@us.ibm.com>
      Cc: Christian Borntraeger <cborntra@de.ibm.com>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Signed-off-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      e81ce1f7
  3. 17 2月, 2007 11 次提交
  4. 12 2月, 2007 1 次提交
  5. 30 9月, 2006 1 次提交
  6. 15 8月, 2006 1 次提交
  7. 01 8月, 2006 1 次提交
  8. 04 7月, 2006 2 次提交
  9. 28 6月, 2006 2 次提交
  10. 26 6月, 2006 2 次提交
  11. 01 6月, 2006 1 次提交
  12. 26 4月, 2006 2 次提交
  13. 22 4月, 2006 1 次提交
  14. 11 4月, 2006 1 次提交
  15. 01 4月, 2006 3 次提交
  16. 27 3月, 2006 6 次提交
  17. 07 3月, 2006 1 次提交
    • T
      [PATCH] fix next_timer_interrupt() for hrtimer · 69239749
      Tony Lindgren 提交于
      Also from Thomas Gleixner <tglx@linutronix.de>
      
      Function next_timer_interrupt() got broken with a recent patch
      6ba1b912 as sys_nanosleep() was moved to
      hrtimer.  This broke things as next_timer_interrupt() did not check hrtimer
      tree for next event.
      
      Function next_timer_interrupt() is needed with dyntick (CONFIG_NO_IDLE_HZ,
      VST) implementations, as the system can be in idle when next hrtimer event
      was supposed to happen.  At least ARM and S390 currently use
      next_timer_interrupt().
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Russell King <rmk@arm.linux.org.uk>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      69239749
  18. 15 2月, 2006 1 次提交
  19. 02 2月, 2006 1 次提交