[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] Remove send_IPI_all, send_IPI_allbutself and send_IPI_self



# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID 387b6824ce29949361c5db5242c53f877317928d
# Parent  590c33d6097cf5829686142919da856990af50ba
Remove send_IPI_all, send_IPI_allbutself and send_IPI_self
shortcutting IPI functions. They're either unused or used so
frequently that we may as well simplify things and always use
send_IPI_mask.

Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>

diff -r 590c33d6097c -r 387b6824ce29 xen/arch/x86/genapic/default.c
--- a/xen/arch/x86/genapic/default.c    Mon Apr  3 14:52:58 2006
+++ b/xen/arch/x86/genapic/default.c    Mon Apr  3 15:35:06 2006
@@ -18,15 +18,6 @@
 #include <asm/mach-default/mach_ipi.h>
 #include <asm/mach-default/mach_mpparse.h>
 
-#ifdef CONFIG_HOTPLUG_CPU
-#define DEFAULT_SEND_IPI       (1)
-#else
-#define DEFAULT_SEND_IPI       (0)
-#endif
-
-int no_broadcast = DEFAULT_SEND_IPI;
-integer_param("no_ipi_broadcast", no_broadcast);
-
 /* should be called last. */
 static __init int probe_default(void)
 { 
@@ -34,12 +25,3 @@
 } 
 
 struct genapic apic_default = APIC_INIT("default", probe_default); 
-
-static int __init print_ipi_mode(void)
-{
-       if (genapic == &apic_default)
-               printk("Using IPI %sShortcut mode\n",
-                      no_broadcast ? "No-" : "");
-       return 0;
-}
-__initcall(print_ipi_mode);
diff -r 590c33d6097c -r 387b6824ce29 xen/arch/x86/smp.c
--- a/xen/arch/x86/smp.c        Mon Apr  3 14:52:58 2006
+++ b/xen/arch/x86/smp.c        Mon Apr  3 15:35:06 2006
@@ -21,6 +21,7 @@
 #include <asm/smpboot.h>
 #include <asm/hardirq.h>
 #include <mach_apic.h>
+#include <mach_ipi.h>
 
 /*
  *     Some notes on x86 processor bugs affecting SMP operation:
@@ -74,38 +75,6 @@
     return SET_APIC_DEST_FIELD(mask);
 }
 
-void __send_IPI_shortcut(unsigned int shortcut, int vector)
-{
-    /*
-     * Subtle. In the case of the 'never do double writes' workaround
-     * we have to lock out interrupts to be safe.  As we don't care
-     * of the value read we use an atomic rmw access to avoid costly
-     * cli/sti.  Otherwise we use an even cheaper single atomic write
-     * to the APIC.
-     */
-    unsigned int cfg;
-
-    /*
-     * Wait for idle.
-     */
-    apic_wait_icr_idle();
-
-    /*
-     * No need to touch the target chip field
-     */
-    cfg = __prepare_ICR(shortcut, vector);
-
-    /*
-     * Send the IPI. The write to APIC_ICR fires this off.
-     */
-    apic_write_around(APIC_ICR, cfg);
-}
-
-void send_IPI_self(int vector)
-{
-    __send_IPI_shortcut(APIC_DEST_SELF, vector);
-}
-
 static inline void check_IPI_mask(cpumask_t cpumask)
 {
     /*
@@ -116,9 +85,6 @@
     ASSERT(!cpus_empty(cpumask));
 }
 
-/*
- * This is only used on smaller machines.
- */
 void send_IPI_mask_bitmask(cpumask_t cpumask, int vector)
 {
     unsigned long mask = cpus_addr(cpumask)[0];
@@ -168,35 +134,32 @@
 
     local_irq_save(flags);
 
-    for (query_cpu = 0; query_cpu < NR_CPUS; ++query_cpu) {
-        if (cpu_isset(query_cpu, mask)) {
+    for_each_cpu_mask( query_cpu, mask )
+    {
+        /*
+         * Wait for idle.
+         */
+        apic_wait_icr_idle();
                
-            /*
-             * Wait for idle.
-             */
-            apic_wait_icr_idle();
+        /*
+         * prepare target chip field
+         */
+        cfg = __prepare_ICR2(cpu_to_logical_apicid(query_cpu));
+        apic_write_around(APIC_ICR2, cfg);
                
-            /*
-             * prepare target chip field
-             */
-            cfg = __prepare_ICR2(cpu_to_logical_apicid(query_cpu));
-            apic_write_around(APIC_ICR2, cfg);
-               
-            /*
-             * program the ICR
-             */
-            cfg = __prepare_ICR(0, vector);
+        /*
+         * program the ICR
+         */
+        cfg = __prepare_ICR(0, vector);
                        
-            /*
-             * Send the IPI. The write to APIC_ICR fires this off.
-             */
-            apic_write_around(APIC_ICR, cfg);
-        }
-    }
+        /*
+         * Send the IPI. The write to APIC_ICR fires this off.
+         */
+        apic_write_around(APIC_ICR, cfg);
+    }
+
     local_irq_restore(flags);
 }
-
-#include <mach_ipi.h>
 
 static spinlock_t flush_lock = SPIN_LOCK_UNLOCKED;
 static cpumask_t flush_cpumask;
@@ -241,20 +204,12 @@
 /* Call with no locks held and interrupts enabled (e.g., softirq context). */
 void new_tlbflush_clock_period(void)
 {
-    ASSERT(local_irq_is_enabled());
-    
+    cpumask_t allbutself;
+
     /* Flush everyone else. We definitely flushed just before entry. */
-    if ( num_online_cpus() > 1 )
-    {
-        spin_lock(&flush_lock);
-        flush_cpumask = cpu_online_map;
-        flush_va      = FLUSHVA_ALL;
-        send_IPI_allbutself(INVALIDATE_TLB_VECTOR);
-        cpu_clear(smp_processor_id(), flush_cpumask);
-        while ( !cpus_empty(flush_cpumask) )
-            cpu_relax();
-        spin_unlock(&flush_lock);
-    }
+    allbutself = cpu_online_map;
+    cpu_clear(smp_processor_id(), allbutself);
+    __flush_tlb_mask(allbutself, FLUSHVA_ALL);
 
     /* No need for atomicity: we are the only possible updater. */
     ASSERT(tlbflush_clock == 0);
diff -r 590c33d6097c -r 387b6824ce29 xen/include/asm-x86/genapic.h
--- a/xen/include/asm-x86/genapic.h     Mon Apr  3 14:52:58 2006
+++ b/xen/include/asm-x86/genapic.h     Mon Apr  3 15:35:06 2006
@@ -54,8 +54,6 @@
        
        /* ipi */
        void (*send_IPI_mask)(cpumask_t mask, int vector);
-       void (*send_IPI_allbutself)(int vector);
-       void (*send_IPI_all)(int vector);
 }; 
 
 #define APICFUNC(x) .x = x
@@ -85,8 +83,6 @@
        APICFUNC(cpu_mask_to_apicid), \
        APICFUNC(acpi_madt_oem_check), \
        APICFUNC(send_IPI_mask), \
-       APICFUNC(send_IPI_allbutself), \
-       APICFUNC(send_IPI_all), \
        APICFUNC(enable_apic_mode), \
        APICFUNC(phys_pkg_id), \
        }
diff -r 590c33d6097c -r 387b6824ce29 xen/include/asm-x86/mach-bigsmp/mach_ipi.h
--- a/xen/include/asm-x86/mach-bigsmp/mach_ipi.h        Mon Apr  3 14:52:58 2006
+++ b/xen/include/asm-x86/mach-bigsmp/mach_ipi.h        Mon Apr  3 15:35:06 2006
@@ -8,18 +8,4 @@
        send_IPI_mask_sequence(mask, vector);
 }
 
-static inline void send_IPI_allbutself(int vector)
-{
-       cpumask_t mask = cpu_online_map;
-       cpu_clear(smp_processor_id(), mask);
-
-       if (!cpus_empty(mask))
-               send_IPI_mask(mask, vector);
-}
-
-static inline void send_IPI_all(int vector)
-{
-       send_IPI_mask(cpu_online_map, vector);
-}
-
 #endif /* __ASM_MACH_IPI_H */
diff -r 590c33d6097c -r 387b6824ce29 xen/include/asm-x86/mach-default/mach_ipi.h
--- a/xen/include/asm-x86/mach-default/mach_ipi.h       Mon Apr  3 14:52:58 2006
+++ b/xen/include/asm-x86/mach-default/mach_ipi.h       Mon Apr  3 15:35:06 2006
@@ -2,50 +2,10 @@
 #define __ASM_MACH_IPI_H
 
 void send_IPI_mask_bitmask(cpumask_t mask, int vector);
-void __send_IPI_shortcut(unsigned int shortcut, int vector);
-
-extern int no_broadcast;
 
 static inline void send_IPI_mask(cpumask_t mask, int vector)
 {
        send_IPI_mask_bitmask(mask, vector);
 }
 
-static inline void __local_send_IPI_allbutself(int vector)
-{
-       if (no_broadcast) {
-               cpumask_t mask = cpu_online_map;
-
-               cpu_clear(smp_processor_id(), mask);
-               send_IPI_mask(mask, vector);
-       } else
-               __send_IPI_shortcut(APIC_DEST_ALLBUT, vector);
-}
-
-static inline void __local_send_IPI_all(int vector)
-{
-       if (no_broadcast)
-               send_IPI_mask(cpu_online_map, vector);
-       else
-               __send_IPI_shortcut(APIC_DEST_ALLINC, vector);
-}
-
-static inline void send_IPI_allbutself(int vector)
-{
-       /*
-        * if there are no other CPUs in the system then we get an APIC send 
-        * error if we try to broadcast, thus avoid sending IPIs in this case.
-        */
-       if (!(num_online_cpus() > 1))
-               return;
-
-       __local_send_IPI_allbutself(vector);
-       return;
-}
-
-static inline void send_IPI_all(int vector)
-{
-       __local_send_IPI_all(vector);
-}
-
 #endif /* __ASM_MACH_IPI_H */
diff -r 590c33d6097c -r 387b6824ce29 xen/include/asm-x86/mach-es7000/mach_ipi.h
--- a/xen/include/asm-x86/mach-es7000/mach_ipi.h        Mon Apr  3 14:52:58 2006
+++ b/xen/include/asm-x86/mach-es7000/mach_ipi.h        Mon Apr  3 15:35:06 2006
@@ -8,17 +8,4 @@
        send_IPI_mask_sequence(mask, vector);
 }
 
-static inline void send_IPI_allbutself(int vector)
-{
-       cpumask_t mask = cpu_online_map;
-       cpu_clear(smp_processor_id(), mask);
-       if (!cpus_empty(mask))
-               send_IPI_mask(mask, vector);
-}
-
-static inline void send_IPI_all(int vector)
-{
-       send_IPI_mask(cpu_online_map, vector);
-}
-
 #endif /* __ASM_MACH_IPI_H */
diff -r 590c33d6097c -r 387b6824ce29 xen/include/asm-x86/mach-generic/mach_ipi.h
--- a/xen/include/asm-x86/mach-generic/mach_ipi.h       Mon Apr  3 14:52:58 2006
+++ b/xen/include/asm-x86/mach-generic/mach_ipi.h       Mon Apr  3 15:35:06 2006
@@ -4,7 +4,5 @@
 #include <asm/genapic.h>
 
 #define send_IPI_mask (genapic->send_IPI_mask)
-#define send_IPI_allbutself (genapic->send_IPI_allbutself)
-#define send_IPI_all (genapic->send_IPI_all)
 
 #endif
diff -r 590c33d6097c -r 387b6824ce29 xen/include/asm-x86/mach-summit/mach_ipi.h
--- a/xen/include/asm-x86/mach-summit/mach_ipi.h        Mon Apr  3 14:52:58 2006
+++ b/xen/include/asm-x86/mach-summit/mach_ipi.h        Mon Apr  3 15:35:06 2006
@@ -8,18 +8,4 @@
        send_IPI_mask_sequence(mask, vector);
 }
 
-static inline void send_IPI_allbutself(int vector)
-{
-       cpumask_t mask = cpu_online_map;
-       cpu_clear(smp_processor_id(), mask);
-
-       if (!cpus_empty(mask))
-               send_IPI_mask(mask, vector);
-}
-
-static inline void send_IPI_all(int vector)
-{
-       send_IPI_mask(cpu_online_map, vector);
-}
-
 #endif /* __ASM_MACH_IPI_H */

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.