source: trunk/packages/xen-3.1/xen-3.1/patches/linux-2.6.18/softlockup-no-idle-hz.patch @ 34

Last change on this file since 34 was 34, checked in by hartmans, 18 years ago

Add xen and xen-common

  • Property svn:mime-type set to text/x-patch
File size: 2.0 KB
  • include/linux/sched.h

    diff -pruN ../orig-linux-2.6.18/include/linux/sched.h ./include/linux/sched.h
    old new extern void update_process_times(int use 
    211211extern void scheduler_tick(void);
    212212
    213213#ifdef CONFIG_DETECT_SOFTLOCKUP
     214extern unsigned long softlockup_get_next_event(void);
    214215extern void softlockup_tick(void);
    215216extern void spawn_softlockup_task(void);
    216217extern void touch_softlockup_watchdog(void);
    217218#else
     219static inline unsigned long softlockup_get_next_event(void)
     220{
     221        return MAX_JIFFY_OFFSET;
     222}
    218223static inline void softlockup_tick(void)
    219224{
    220225}
  • kernel/softlockup.c

    diff -pruN ../orig-linux-2.6.18/kernel/softlockup.c ./kernel/softlockup.c
    old new void touch_softlockup_watchdog(void) 
    4040}
    4141EXPORT_SYMBOL(touch_softlockup_watchdog);
    4242
     43unsigned long softlockup_get_next_event(void)
     44{
     45        int this_cpu = smp_processor_id();
     46        unsigned long touch_timestamp = per_cpu(touch_timestamp, this_cpu);
     47
     48        if (per_cpu(print_timestamp, this_cpu) == touch_timestamp ||
     49                did_panic ||
     50                        !per_cpu(watchdog_task, this_cpu))
     51                return MAX_JIFFY_OFFSET;
     52
     53        return max_t(long, 0, touch_timestamp + HZ - jiffies);
     54}
     55
    4356/*
    4457 * This callback runs from the timer interrupt, and checks
    4558 * whether the watchdog thread has hung or not:
  • kernel/timer.c

    diff -pruN ../orig-linux-2.6.18/kernel/timer.c ./kernel/timer.c
    old new unsigned long next_timer_interrupt(void) 
    485485                if (hr_expires < 3)
    486486                        return hr_expires + jiffies;
    487487        }
    488         hr_expires += jiffies;
     488        hr_expires = min_t(unsigned long,
     489                           softlockup_get_next_event(),
     490                           hr_expires) + jiffies;
    489491
    490492        base = __get_cpu_var(tvec_bases);
    491493        spin_lock(&base->lock);
Note: See TracBrowser for help on using the repository browser.