]> xenbits.xensource.com Git - legacy/linux-2.6.18-xen.git/commitdiff
xen/x86: eliminate nesting of run-queue locks inside xtime_lock
authorKeir Fraser <keir.fraser@citrix.com>
Tue, 10 Aug 2010 14:47:41 +0000 (15:47 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Tue, 10 Aug 2010 14:47:41 +0000 (15:47 +0100)
From: Zdenek Salvet <salvet@ics.muni.cz>

According to Debian bug 591362 this has been causing problems. While
no proof was given that the inverse lock order does actually occur
anywhere (with interrupts enabled), it is plain unnecessary to take
the risk.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
arch/i386/kernel/time-xen.c

index 60292c4ecde6e6b90587b4f1220313b9acd14fb1..0b31fc5628f61ab86f88045c63a6104c5cff4778 100644 (file)
@@ -654,6 +654,7 @@ irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
        s64 delta, delta_cpu, stolen, blocked;
        u64 sched_time;
        unsigned int i, cpu = smp_processor_id();
+       int schedule_clock_was_set_work = 0;
        struct shadow_time_info *shadow = &per_cpu(shadow_time, cpu);
        struct vcpu_runstate_info *runstate = &per_cpu(runstate, cpu);
 
@@ -715,12 +716,14 @@ irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 
        if (shadow_tv_version != HYPERVISOR_shared_info->wc_version) {
                update_wallclock();
-               if (keventd_up())
-                       schedule_work(&clock_was_set_work);
+               schedule_clock_was_set_work = 1;
        }
 
        write_sequnlock(&xtime_lock);
 
+       if (schedule_clock_was_set_work && keventd_up())
+               schedule_work(&clock_was_set_work);
+
        /*
         * Account stolen ticks.
         * HACK: Passing NULL to account_steal_time()