hrtimer: Tune hrtimer_interrupt hang logic

Previous thread: lib/checksum: fix one more thinko by Linux Kernel Mailing List on Friday, December 11, 2009 - 9:59 pm. (1 message)

Next thread: futex: Take mmap_sem for get_user_pages in fault_in_user_writeable by Linux Kernel Mailing List on Friday, December 11, 2009 - 9:59 pm. (1 message)
From: Linux Kernel Mailing List
Date: Friday, December 11, 2009 - 9:59 pm

Gitweb:     http://git.kernel.org/linus/41d2e494937715d3150e5c75d01f0e75ae899337
Commit:     41d2e494937715d3150e5c75d01f0e75ae899337
Parent:     3067e02f8f3ae2f3f02ba76400d03b8bcb4942b0
Author:     Thomas Gleixner <tglx@linutronix.de>
AuthorDate: Fri Nov 13 17:05:44 2009 +0100
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Thu Dec 10 13:08:11 2009 +0100

    hrtimer: Tune hrtimer_interrupt hang logic
    
    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: Michael Tokarev <mjt@tls.msk.ru>
    Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
    Tested-by: Marcelo Tosatti <mtosatti@redhat.com>
    Cc: kvm@vger.kernel.org
---
 include/linux/hrtimer.h  |   13 ++++--
 kernel/hrtimer.c         |   97 +++++++++++++++++++++++++++-------------------
 kernel/time/timer_list.c |    5 ++-
 3 files changed, 70 insertions(+), 45 deletions(-)

diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h
index 9bace4b..040b679 100644
--- a/include/linux/hrtimer.h
+++ b/include/linux/hrtimer.h
@@ -162,10 +162,11 @@ struct hrtimer_clock_base {
  * ...
Previous thread: lib/checksum: fix one more thinko by Linux Kernel Mailing List on Friday, December 11, 2009 - 9:59 pm. (1 message)

Next thread: futex: Take mmap_sem for get_user_pages in fault_in_user_writeable by Linux Kernel Mailing List on Friday, December 11, 2009 - 9:59 pm. (1 message)