bitkeeper revision 1.914 (40ab6d61x-o8a0EkAPFPNgH58cGauQ)
authorkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>
Wed, 19 May 2004 14:21:21 +0000 (14:21 +0000)
committerkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>
Wed, 19 May 2004 14:21:21 +0000 (14:21 +0000)
More TLB flush fixes.

xen/arch/i386/flushtlb.c
xen/arch/i386/setup.c
xen/arch/i386/smp.c
xen/common/softirq.c
xen/include/xen/interrupt.h

index 8712682d36358c9cdc9d2069f217c6c899a07e23..c53f52161cbe8bda72a5de1aeca90a1d29dbb02a 100644 (file)
@@ -9,6 +9,7 @@
 
 #include <xen/config.h>
 #include <xen/sched.h>
+#include <xen/interrupt.h>
 #include <asm/flushtlb.h>
 
 u32 tlbflush_clock;
@@ -24,7 +25,7 @@ void tlb_clocktick(void)
 #ifdef CONFIG_SMP
         if ( unlikely(((y = ny+1) & TLBCLOCK_EPOCH_MASK) == 0) )
         {
-            new_tlbflush_clock_period();
+            raise_softirq(NEW_TLBFLUSH_CLOCK_PERIOD_SOFTIRQ);
             y = tlbflush_clock;
             break;
         }
index 06193aeb6b4b31fcb93a6ddfbf787ff57863c594..1772a7afc4d96a2b0b1c9522083c8417b2a1e9f6 100644 (file)
@@ -345,6 +345,10 @@ void __init start_of_day(void)
     memguard_guard_range(cpu0_stack, PAGE_SIZE);
 #endif
 
+    open_softirq(NEW_TLBFLUSH_CLOCK_PERIOD_SOFTIRQ, 
+                 (void *)new_tlbflush_clock_period,
+                 NULL);
+
     if ( opt_watchdog ) 
         nmi_watchdog = NMI_LOCAL_APIC;
 
index 363d61626e411f66e89d244f8c2eccb50dcdbafc..e79385c278937a332ab9143f29506ebb3cdd718a 100644 (file)
@@ -288,11 +288,13 @@ void flush_tlb_mask(unsigned long mask)
     }
 }
 
+/*
+ * NB. Must be called with no locks held and interrupts enabled.
+ *     (e.g., softirq context).
+ */
 void new_tlbflush_clock_period(void)
 {
-    /* Avoid deadlock because we might be reentering a flush_lock region. */
-    if ( unlikely(!spin_trylock(&flush_lock)) )
-        return;
+    spin_lock(&flush_lock);
 
     /* Someone may acquire the lock and execute the flush before us. */
     if ( ((tlbflush_clock+1) & TLBCLOCK_EPOCH_MASK) != 0 )
index d400406239cefa4ef5dd1bde04f57204c329436b..3924fbf56ead0296915f701bbf3b1036d6979b0c 100644 (file)
@@ -61,7 +61,7 @@ inline void cpu_raise_softirq(unsigned int cpu, unsigned int nr)
 
 void raise_softirq(unsigned int nr)
 {
-    cpu_raise_softirq(smp_processor_id(), nr);
+    __cpu_raise_softirq(smp_processor_id(), nr);
 }
 
 void open_softirq(int nr, void (*action)(struct softirq_action*), void *data)
index a55e70269fa8712a2fb5de1e45645079f008358f..884c14d13a6a11068efc5859a0e2634fb1f303bd 100644 (file)
@@ -42,7 +42,8 @@ enum
        AC_TIMER_SOFTIRQ,
        TASKLET_SOFTIRQ,
         BLKDEV_RESPONSE_SOFTIRQ,
-        NET_TX_SOFTIRQ
+        NET_TX_SOFTIRQ,
+        NEW_TLBFLUSH_CLOCK_PERIOD_SOFTIRQ
 };
 
 /* softirq mask and active fields moved to irq_cpustat_t in