hrtimer: Tune hrtimer_interrupt hang logic
[safe/jmp/linux-2.6] / include / linux / hrtimer.h
index 7400900..040b679 100644 (file)
@@ -21,6 +21,7 @@
 #include <linux/list.h>
 #include <linux/wait.h>
 #include <linux/percpu.h>
+#include <linux/timer.h>
 
 
 struct hrtimer_clock_base;
@@ -90,7 +91,6 @@ enum hrtimer_restart {
  * @function:  timer expiry callback function
  * @base:      pointer to the timer base (per cpu and per clock)
  * @state:     state information (See bit values above)
- * @cb_entry:  list head to enqueue an expired timer into the callback list
  * @start_site:        timer statistics field to store the site where the timer
  *             was started
  * @start_comm: timer statistics field to store the name of the process which
@@ -107,7 +107,6 @@ struct hrtimer {
        enum hrtimer_restart            (*function)(struct hrtimer *);
        struct hrtimer_clock_base       *base;
        unsigned long                   state;
-       struct list_head                cb_entry;
 #ifdef CONFIG_TIMER_STATS
        int                             start_pid;
        void                            *start_site;
@@ -163,10 +162,11 @@ struct hrtimer_clock_base {
  * @expires_next:      absolute time of the next event which was scheduled
  *                     via clock_set_next_event()
  * @hres_active:       State of high resolution mode
- * @check_clocks:      Indictator, when set evaluate time source and clock
- *                     event devices whether high resolution mode can be
- *                     activated.
- * @nr_events:         Total number of timer interrupt events
+ * @hang_detected:     The last hrtimer interrupt detected a hang
+ * @nr_events:         Total number of hrtimer interrupt events
+ * @nr_retries:                Total number of hrtimer interrupt retries
+ * @nr_hangs:          Total number of hrtimer interrupt hangs
+ * @max_hang_time:     Maximum time spent in hrtimer_interrupt
  */
 struct hrtimer_cpu_base {
        spinlock_t                      lock;
@@ -174,7 +174,11 @@ struct hrtimer_cpu_base {
 #ifdef CONFIG_HIGH_RES_TIMERS
        ktime_t                         expires_next;
        int                             hres_active;
+       int                             hang_detected;
        unsigned long                   nr_events;
+       unsigned long                   nr_retries;
+       unsigned long                   nr_hangs;
+       ktime_t                         max_hang_time;
 #endif
 };
 
@@ -447,6 +451,8 @@ extern void timer_stats_update_stats(void *timer, pid_t pid, void *startf,
 
 static inline void timer_stats_account_hrtimer(struct hrtimer *timer)
 {
+       if (likely(!timer_stats_active))
+               return;
        timer_stats_update_stats(timer, timer->start_pid, timer->start_site,
                                 timer->function, timer->start_comm, 0);
 }