ia64/linux-2.6.18-xen.hg

changeset 22:61ed8662b69c

Imported patch softlockup-no-idle-hz.patch from xen-unstable.hg 15200:bd3d6b4c52ec
author Ian Campbell <ian.campbell@xensource.com>
date Mon Jun 04 10:05:24 2007 +0100 (2007-06-04)
parents 139f7610ddf6
children 9d24e876046f
files include/linux/sched.h kernel/softlockup.c kernel/timer.c
line diff
     1.1 --- a/include/linux/sched.h	Mon Jun 04 10:05:24 2007 +0100
     1.2 +++ b/include/linux/sched.h	Mon Jun 04 10:05:24 2007 +0100
     1.3 @@ -211,10 +211,15 @@ extern void update_process_times(int use
     1.4  extern void scheduler_tick(void);
     1.5  
     1.6  #ifdef CONFIG_DETECT_SOFTLOCKUP
     1.7 +extern unsigned long softlockup_get_next_event(void);
     1.8  extern void softlockup_tick(void);
     1.9  extern void spawn_softlockup_task(void);
    1.10  extern void touch_softlockup_watchdog(void);
    1.11  #else
    1.12 +static inline unsigned long softlockup_get_next_event(void)
    1.13 +{
    1.14 +	return MAX_JIFFY_OFFSET;
    1.15 +}
    1.16  static inline void softlockup_tick(void)
    1.17  {
    1.18  }
     2.1 --- a/kernel/softlockup.c	Mon Jun 04 10:05:24 2007 +0100
     2.2 +++ b/kernel/softlockup.c	Mon Jun 04 10:05:24 2007 +0100
     2.3 @@ -40,6 +40,19 @@ void touch_softlockup_watchdog(void)
     2.4  }
     2.5  EXPORT_SYMBOL(touch_softlockup_watchdog);
     2.6  
     2.7 +unsigned long softlockup_get_next_event(void)
     2.8 +{
     2.9 +	int this_cpu = smp_processor_id();
    2.10 +	unsigned long touch_timestamp = per_cpu(touch_timestamp, this_cpu);
    2.11 +
    2.12 +	if (per_cpu(print_timestamp, this_cpu) == touch_timestamp ||
    2.13 +		did_panic ||
    2.14 +			!per_cpu(watchdog_task, this_cpu))
    2.15 +		return MAX_JIFFY_OFFSET;
    2.16 +
    2.17 +	return max_t(long, 0, touch_timestamp + HZ - jiffies);
    2.18 +}
    2.19 +
    2.20  /*
    2.21   * This callback runs from the timer interrupt, and checks
    2.22   * whether the watchdog thread has hung or not:
     3.1 --- a/kernel/timer.c	Mon Jun 04 10:05:24 2007 +0100
     3.2 +++ b/kernel/timer.c	Mon Jun 04 10:05:24 2007 +0100
     3.3 @@ -485,7 +485,9 @@ unsigned long next_timer_interrupt(void)
     3.4  		if (hr_expires < 3)
     3.5  			return hr_expires + jiffies;
     3.6  	}
     3.7 -	hr_expires += jiffies;
     3.8 +	hr_expires = min_t(unsigned long,
     3.9 +			   softlockup_get_next_event(),
    3.10 +			   hr_expires) + jiffies;
    3.11  
    3.12  	base = __get_cpu_var(tvec_bases);
    3.13  	spin_lock(&base->lock);