1. 20 Jul, 2007 1 commit
  2. 19 Jul, 2007 1 commit
  3. 17 Jul, 2007 1 commit
  4. 16 Jul, 2007 2 commits
  5. 30 May, 2007 1 commit
  6. 14 May, 2007 1 commit
  7. 10 May, 2007 1 commit
  8. 09 May, 2007 3 commits
  9. 08 May, 2007 3 commits
    • Pavel Emelianov's avatar
      Introduce a handy list_first_entry macro · b5e61818
      Pavel Emelianov authored
      
      There are many places in the kernel where the construction like
      
         foo = list_entry(head->next, struct foo_struct, list);
      
      are used.
      The code might look more descriptive and neat if using the macro
      
         list_first_entry(head, type, member) \
                   list_entry((head)->next, type, member)
      
      Here is the macro itself and the examples of its usage in the generic code.
       If it will turn out to be useful, I can prepare the set of patches to
      inject in into arch-specific code, drivers, networking, etc.
      Signed-off-by: default avatarPavel Emelianov <xemul@openvz.org>
      Signed-off-by: default avatarKirill Korotaev <dev@openvz.org>
      Cc: Randy Dunlap <randy.dunlap@oracle.com>
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: Zach Brown <zach.brown@oracle.com>
      Cc: Davide Libenzi <davidel@xmailserver.org>
      Cc: John McCutchan <ttb@tentacle.dhs.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: john stultz <johnstul@us.ibm.com>
      Cc: Ram Pai <linuxram@us.ibm.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      b5e61818
    • john stultz's avatar
      Move timekeeping code to timekeeping.c · 8524070b
      john stultz authored
      
      Move the timekeeping code out of kernel/timer.c and into
      kernel/time/timekeeping.c.  I made no cleanups or other changes in transit.
      
      [akpm@linux-foundation.org: build fix]
      Signed-off-by: default avatarJohn Stultz <johnstul@us.ibm.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      8524070b
    • Venki Pallipadi's avatar
      Add support for deferrable timers · 6e453a67
      Venki Pallipadi authored
      
      Introduce a new flag for timers - deferrable: Timers that work normally
      when system is busy.  But, will not cause CPU to come out of idle (just to
      service this timer), when CPU is idle.  Instead, this timer will be
      serviced when CPU eventually wakes up with a subsequent non-deferrable
      timer.
      
      The main advantage of this is to avoid unnecessary timer interrupts when
      CPU is idle.  If the routine currently called by a timer can wait until
      next event without any issues, this new timer can be used to setup timer
      event for that routine.  This, with dynticks, allows CPUs to be lazy,
      allowing them to stay in idle for extended period of time by reducing
      unnecesary wakeup and thereby reducing the power consumption.
      
      This patch:
      
      Builds this new timer on top of existing timer infrastructure.  It uses
      last bit in 'base' pointer of timer_list structure to store this deferrable
      timer flag.  __next_timer_interrupt() function skips over these deferrable
      timers when CPU looks for next timer event for which it has to wake up.
      
      This is exported by a new interface init_timer_deferrable() that can be
      called in place of regular init_timer().
      
      [akpm@linux-foundation.org: Privatise a #define]
      Signed-off-by: default avatarVenkatesh Pallipadi <venkatesh.pallipadi@intel.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Oleg Nesterov <oleg@tv-sign.ru>
      Cc: Dave Jones <davej@codemonkey.org.uk>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      6e453a67
  10. 26 Apr, 2007 1 commit
  11. 07 Apr, 2007 1 commit
    • Ingo Molnar's avatar
      [PATCH] high-res timers: resume fix · 995f054f
      Ingo Molnar authored
      
      Soeren Sonnenburg reported that upon resume he is getting
      this backtrace:
      
       [<c0119637>] smp_apic_timer_interrupt+0x57/0x90
       [<c0142d30>] retrigger_next_event+0x0/0xb0
       [<c0104d30>] apic_timer_interrupt+0x28/0x30
       [<c0142d30>] retrigger_next_event+0x0/0xb0
       [<c0140068>] __kfifo_put+0x8/0x90
       [<c0130fe5>] on_each_cpu+0x35/0x60
       [<c0143538>] clock_was_set+0x18/0x20
       [<c0135cdc>] timekeeping_resume+0x7c/0xa0
       [<c02aabe1>] __sysdev_resume+0x11/0x80
       [<c02ab0c7>] sysdev_resume+0x47/0x80
       [<c02b0b05>] device_power_up+0x5/0x10
      
      it turns out that on resume we mistakenly re-enable interrupts too
      early.  Do the timer retrigger only on the current CPU.
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      Acked-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Acked-by: default avatarSoeren Sonnenburg <kernel@nn7.de>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      995f054f
  12. 25 Mar, 2007 1 commit
  13. 06 Mar, 2007 2 commits
  14. 05 Mar, 2007 1 commit
    • Heiko Carstens's avatar
      [PATCH] timer/hrtimer: take per cpu locks in sane order · e81ce1f7
      Heiko Carstens authored
      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: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      e81ce1f7
  15. 01 Mar, 2007 2 commits
  16. 16 Feb, 2007 11 commits
  17. 13 Feb, 2007 1 commit
    • Eric Dumazet's avatar
      [PATCH] x86-64: get rid of ARCH_HAVE_XTIME_LOCK · 5809f9d4
      Eric Dumazet authored
      
      ARCH_HAVE_XTIME_LOCK is used by x86_64 arch .  This arch needs to place a
      read only copy of xtime_lock into vsyscall page.  This read only copy is
      named __xtime_lock, and xtime_lock is defined in
      arch/x86_64/kernel/vmlinux.lds.S as an alias.  So the declaration of
      xtime_lock in kernel/timer.c was guarded by ARCH_HAVE_XTIME_LOCK define,
      defined to true on x86_64.
      
      We can get same result with _attribute__((weak)) in the declaration. linker
      should do the job.
      Signed-off-by: default avatarEric Dumazet <dada1@cosmosbay.com>
      Signed-off-by: default avatarAndi Kleen <ak@suse.de>
      Cc: Andi Kleen <ak@suse.de>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      5809f9d4
  18. 11 Feb, 2007 3 commits
  19. 22 Dec, 2006 1 commit
  20. 13 Dec, 2006 1 commit
    • Eric Dumazet's avatar
      [PATCH] Optimize calc_load() · cd7175ed
      Eric Dumazet authored
      
      calc_load() is called by timer interrupt to update avenrun[].  It currently
      calls nr_active() at each timer tick (HZ per second), while the update of
      avenrun[] is done only once every 5 seconds.  (LOAD_FREQ=5 Hz)
      
      nr_active() is quite expensive on SMP machines, since it has to sum up
      nr_running and nr_uninterruptible of all online CPUS, bringing foreign
      dirty cache lines.
      
      This patch is an optimization of calc_load() so that nr_active() is called
      only if we need it.
      
      The use of unlikely() is welcome since the condition is true only once every
      5*HZ time.
      Signed-off-by: default avatarEric Dumazet <dada1@cosmosbay.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Acked-by: default avatar"Siddha, Suresh B" <suresh.b.siddha@intel.com>
      Cc: Nick Piggin <nickpiggin@yahoo.com.au>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      cd7175ed
  21. 10 Dec, 2006 1 commit