1. 10 12月, 2009 1 次提交
    • T
      hrtimer: Tune hrtimer_interrupt hang logic · 41d2e494
      Thomas Gleixner 提交于
      The hrtimer_interrupt hang logic adjusts min_delta_ns based on the
      execution time of the hrtimer callbacks.
      
      This is error-prone for virtual machines, where a guest vcpu can be
      scheduled out during the execution of the callbacks (and the callbacks
      themselves can do operations that translate to blocking operations in
      the hypervisor), which in can lead to large min_delta_ns rendering the
      system unusable.
      
      Replace the current heuristics with something more reliable. Allow the
      interrupt code to try 3 times to catch up with the lost time. If that
      fails use the total time spent in the interrupt handler to defer the
      next timer interrupt so the system can catch up with other things
      which got delayed. Limit that deferment to 100ms.
      
      The retry events and the maximum time spent in the interrupt handler
      are recorded and exposed via /proc/timer_list
      
      Inspired by a patch from Marcelo.
      Reported-by: NMichael Tokarev <mjt@tls.msk.ru>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Tested-by: NMarcelo Tosatti <mtosatti@redhat.com>
      Cc: kvm@vger.kernel.org
      41d2e494
  2. 14 11月, 2009 2 次提交
    • J
      nohz: Allow 32-bit machines to sleep for more than 2.15 seconds · 97813f2f
      Jon Hunter 提交于
      In the dynamic tick code, "max_delta_ns" (member of the
      "clock_event_device" structure) represents the maximum sleep time
      that can occur between timer events in nanoseconds.
      
      The variable, "max_delta_ns", is defined as an unsigned long
      which is a 32-bit integer for 32-bit machines and a 64-bit
      integer for 64-bit machines (if -m64 option is used for gcc).
      The value of max_delta_ns is set by calling the function
      "clockevent_delta2ns()" which returns a maximum value of LONG_MAX.
      For a 32-bit machine LONG_MAX is equal to 0x7fffffff and in
      nanoseconds this equates to ~2.15 seconds. Hence, the maximum
      sleep time for a 32-bit machine is ~2.15 seconds, where as for
      a 64-bit machine it will be many years.
      
      This patch changes the type of max_delta_ns to be "u64" instead of
      "unsigned long" so that this variable is a 64-bit type for both 32-bit
      and 64-bit machines. It also changes the maximum value returned by
      clockevent_delta2ns() to KTIME_MAX.  Hence this allows a 32-bit
      machine to sleep for longer than ~2.15 seconds. Please note that this
      patch also changes "min_delta_ns" to be "u64" too and although this is
      unnecessary, it makes the patch simpler as it avoids to fixup all
      callers of clockevent_delta2ns().
      
      [ tglx: changed "unsigned long long" to u64 as we use this data type
        	through out the time code ]
      Signed-off-by: NJon Hunter <jon-hunter@ti.com>
      Cc: John Stultz <johnstul@us.ibm.com>
      LKML-Reference: <1250617512-23567-3-git-send-email-jon-hunter@ti.com>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      97813f2f
    • T
      clockevents: Use u32 for mult and shift factors · 23af368e
      Thomas Gleixner 提交于
      The mult and shift factors of clock events differ in their data type
      from those of clock sources for no reason. u32 is sufficient for
      both. shift is always <= 32 and mult is limited to 2^32-1 to avoid
      64bit multiplication overflows in the conversion.
      
      Preparatory patch for a generic mult/shift factor calculation
      function.
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Tested-by: NMikael Pettersson <mikpe@it.uu.se>
      Acked-by: NRalf Baechle <ralf@linux-mips.org>
      Acked-by: NLinus Walleij <linus.walleij@stericsson.com>
      Cc: John Stultz <johnstul@us.ibm.com>
      LKML-Reference: <20091111134229.725664788@linutronix.de>
      23af368e
  3. 02 10月, 2009 1 次提交
  4. 17 8月, 2009 1 次提交
    • A
      timers: Drop write permission on /proc/timer_list · de809347
      Amerigo Wang 提交于
      /proc/timer_list and /proc/slabinfo are not supposed to be
      written, so there should be no write permissions on it.
      Signed-off-by: NWANG Cong <amwang@redhat.com>
      Cc: Pekka Enberg <penberg@cs.helsinki.fi>
      Cc: Vegard Nossum <vegard.nossum@gmail.com>
      Cc: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro>
      Cc: linux-mm@kvack.org
      Cc: Christoph Lameter <cl@linux-foundation.org>
      Cc: David Rientjes <rientjes@google.com>
      Cc: Amerigo Wang <amwang@redhat.com>
      Cc: Matt Mackall <mpm@selenic.com>
      Cc: Arjan van de Ven <arjan@linux.intel.com>
      LKML-Reference: <20090817094525.6355.88682.sendpatchset@localhost.localdomain>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      de809347
  5. 20 10月, 2008 3 次提交
  6. 08 9月, 2008 1 次提交
  7. 06 9月, 2008 1 次提交
  8. 29 4月, 2008 1 次提交
  9. 18 2月, 2008 1 次提交
  10. 02 2月, 2008 1 次提交
  11. 29 10月, 2007 1 次提交
  12. 01 8月, 2007 1 次提交
  13. 18 7月, 2007 1 次提交
    • T
      kallsyms: make KSYM_NAME_LEN include space for trailing '\0' · 9281acea
      Tejun Heo 提交于
      KSYM_NAME_LEN is peculiar in that it does not include the space for the
      trailing '\0', forcing all users to use KSYM_NAME_LEN + 1 when allocating
      buffer.  This is nonsense and error-prone.  Moreover, when the caller
      forgets that it's very likely to subtly bite back by corrupting the stack
      because the last position of the buffer is always cleared to zero.
      
      This patch increments KSYM_NAME_LEN by one and updates code accordingly.
      
      * off-by-one bug in asm-powerpc/kprobes.h::kprobe_lookup_name() macro
        is fixed.
      
      * Where MODULE_NAME_LEN and KSYM_NAME_LEN were used together,
        MODULE_NAME_LEN was treated as if it didn't include space for the
        trailing '\0'.  Fix it.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Acked-by: NPaulo Marques <pmarques@grupopie.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      9281acea
  14. 10 5月, 2007 1 次提交
  15. 09 5月, 2007 2 次提交
  16. 24 3月, 2007 1 次提交
  17. 17 2月, 2007 1 次提交
    • I
      [PATCH] Add debugging feature /proc/timer_list · 289f480a
      Ingo Molnar 提交于
      add /proc/timer_list, which prints all currently pending (high-res) timers,
      all clock-event sources and their parameters in a human-readable form.
      
      Sample output:
      
      Timer List Version: v0.1
      HRTIMER_MAX_CLOCK_BASES: 2
      now at 4246046273872 nsecs
      
      cpu: 0
       clock 0:
        .index:      0
        .resolution: 1 nsecs
        .get_time:   ktime_get_real
        .offset:     1273998312645738432 nsecs
      active timers:
       clock 1:
        .index:      1
        .resolution: 1 nsecs
        .get_time:   ktime_get
        .offset:     0 nsecs
      active timers:
       #0: <f5a90ec8>, hrtimer_sched_tick, hrtimer_stop_sched_tick, swapper/0
       # expires at 4246432689566 nsecs [in 386415694 nsecs]
       #1: <f5a90ec8>, hrtimer_wakeup, do_nanosleep, pcscd/2050
       # expires at 4247018194689 nsecs [in 971920817 nsecs]
       #2: <f5a90ec8>, hrtimer_wakeup, do_nanosleep, irqbalance/1909
       # expires at 4247351358392 nsecs [in 1305084520 nsecs]
       #3: <f5a90ec8>, hrtimer_wakeup, do_nanosleep, crond/2157
       # expires at 4249097614968 nsecs [in 3051341096 nsecs]
       #4: <f5a90ec8>, it_real_fn, do_setitimer, syslogd/1888
       # expires at 4251329900926 nsecs [in 5283627054 nsecs]
        .expires_next   : 4246432689566 nsecs
        .hres_active    : 1
        .check_clocks   : 0
        .nr_events      : 31306
        .idle_tick      : 4246020791890 nsecs
        .tick_stopped   : 1
        .idle_jiffies   : 986504
        .idle_calls     : 40700
        .idle_sleeps    : 36014
        .idle_entrytime : 4246019418883 nsecs
        .idle_sleeptime : 4178181972709 nsecs
      
      cpu: 1
       clock 0:
        .index:      0
        .resolution: 1 nsecs
        .get_time:   ktime_get_real
        .offset:     1273998312645738432 nsecs
      active timers:
       clock 1:
        .index:      1
        .resolution: 1 nsecs
        .get_time:   ktime_get
        .offset:     0 nsecs
      active timers:
       #0: <f5a90ec8>, hrtimer_sched_tick, hrtimer_restart_sched_tick, swapper/0
       # expires at 4246050084568 nsecs [in 3810696 nsecs]
       #1: <f5a90ec8>, hrtimer_wakeup, do_nanosleep, atd/2227
       # expires at 4261010635003 nsecs [in 14964361131 nsecs]
       #2: <f5a90ec8>, hrtimer_wakeup, do_nanosleep, smartd/2332
       # expires at 5469485798970 nsecs [in 1223439525098 nsecs]
        .expires_next   : 4246050084568 nsecs
        .hres_active    : 1
        .check_clocks   : 0
        .nr_events      : 24043
        .idle_tick      : 4246046084568 nsecs
        .tick_stopped   : 0
        .idle_jiffies   : 986510
        .idle_calls     : 26360
        .idle_sleeps    : 22551
        .idle_entrytime : 4246043874339 nsecs
        .idle_sleeptime : 4170763761184 nsecs
      
      tick_broadcast_mask: 00000003
      event_broadcast_mask: 00000001
      
      CPU#0's local event device:
      
      Clock Event Device: lapic
       capabilities:   0000000e
       max_delta_ns:   807385544
       min_delta_ns:   1443
       mult:           44624025
       shift:          32
       set_next_event: lapic_next_event
       set_mode:       lapic_timer_setup
       event_handler:  hrtimer_interrupt
        .installed:  1
        .expires:    4246432689566 nsecs
      
      CPU#1's local event device:
      
      Clock Event Device: lapic
       capabilities:   0000000e
       max_delta_ns:   807385544
       min_delta_ns:   1443
       mult:           44624025
       shift:          32
       set_next_event: lapic_next_event
       set_mode:       lapic_timer_setup
       event_handler:  hrtimer_interrupt
        .installed:  1
        .expires:    4246050084568 nsecs
      
      Clock Event Device: hpet
       capabilities:   00000007
       max_delta_ns:   2147483647
       min_delta_ns:   3352
       mult:           61496110
       shift:          32
       set_next_event: hpet_next_event
       set_mode:       hpet_set_mode
       event_handler:  handle_nextevt_broadcast
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: john stultz <johnstul@us.ibm.com>
      Cc: Roman Zippel <zippel@linux-m68k.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      289f480a