]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] sched: add cacheflush() asm
authorIngo Molnar <mingo@elte.hu>
Thu, 12 Jan 2006 09:05:27 +0000 (01:05 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Thu, 12 Jan 2006 17:08:49 +0000 (09:08 -0800)
Add per-arch sched_cacheflush() which is a write-back cacheflush used by
the migration-cost calibration code at bootup time.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Cc: Nick Piggin <nickpiggin@yahoo.com.au>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
16 files changed:
arch/ia64/kernel/setup.c
include/asm-alpha/system.h
include/asm-arm/system.h
include/asm-arm26/system.h
include/asm-i386/system.h
include/asm-ia64/system.h
include/asm-m32r/system.h
include/asm-mips/system.h
include/asm-parisc/system.h
include/asm-powerpc/system.h
include/asm-ppc/system.h
include/asm-s390/system.h
include/asm-sh/system.h
include/asm-sparc/system.h
include/asm-sparc64/system.h
include/asm-x86_64/system.h

index c33305d8e5eb21593e94396303ea9f0d971a409b..d91c8ff2c0d7d3fe732b49fad5b6177fe1bc5e87 100644 (file)
@@ -60,6 +60,7 @@
 #include <asm/smp.h>
 #include <asm/system.h>
 #include <asm/unistd.h>
+#include <asm/system.h>
 
 #if defined(CONFIG_SMP) && (IA64_CPU_SIZE > PAGE_SIZE)
 # error "struct cpuinfo_ia64 too big!"
@@ -870,6 +871,15 @@ cpu_init (void)
        pm_idle = default_idle;
 }
 
+/*
+ * On SMP systems, when the scheduler does migration-cost autodetection,
+ * it needs a way to flush as much of the CPU's caches as possible.
+ */
+void sched_cacheflush(void)
+{
+       ia64_sal_cache_flush(3);
+}
+
 void
 check_bugs (void)
 {
index 050e86d12891ef704762adba37cabe4a5cb19fe4..766ab868e8ab1a990a4f03aec0c625c6b86c616a 100644 (file)
@@ -140,6 +140,16 @@ extern void halt(void) __attribute__((noreturn));
 struct task_struct;
 extern struct task_struct *alpha_switch_to(unsigned long, struct task_struct*);
 
+/*
+ * On SMP systems, when the scheduler does migration-cost autodetection,
+ * it needs a way to flush as much of the CPU's caches as possible.
+ *
+ * TODO: fill this in!
+ */
+static inline void sched_cacheflush(void)
+{
+}
+
 #define imb() \
 __asm__ __volatile__ ("call_pal %0 #imb" : : "i" (PAL_imb) : "memory")
 
index 5621d61ebc07958e9e7a671def64f410fe26dcb1..0497171df8c9cb20619df9b2d6dfe00372164849 100644 (file)
@@ -171,6 +171,16 @@ do {                                                                       \
        last = __switch_to(prev,prev->thread_info,next->thread_info);   \
 } while (0)
 
+/*
+ * On SMP systems, when the scheduler does migration-cost autodetection,
+ * it needs a way to flush as much of the CPU's caches as possible.
+ *
+ * TODO: fill this in!
+ */
+static inline void sched_cacheflush(void)
+{
+}
+
 /*
  * CPU interrupt mask handling.
  */
index f23fac1938f31d035872e39fd46688b69064824e..1bce6b3590ff3769d28843068349e8a563db3675 100644 (file)
@@ -114,6 +114,16 @@ do {                                                                       \
        last = __switch_to(prev,prev->thread_info,next->thread_info);   \
 } while (0)
 
+/*
+ * On SMP systems, when the scheduler does migration-cost autodetection,
+ * it needs a way to flush as much of the CPU's caches as possible.
+ *
+ * TODO: fill this in!
+ */
+static inline void sched_cacheflush(void)
+{
+}
+
 /*
  * Save the current interrupt enable state & disable IRQs
  */
index 9c0593b7a94e9220c238c9a9b895b694d940ad7f..36a92ed6a9d0d7a916c60f33313bec9d4fb0c494 100644 (file)
@@ -548,6 +548,15 @@ void enable_hlt(void);
 extern int es7000_plat;
 void cpu_idle_wait(void);
 
+/*
+ * On SMP systems, when the scheduler does migration-cost autodetection,
+ * it needs a way to flush as much of the CPU's caches as possible:
+ */
+static inline void sched_cacheflush(void)
+{
+       wbinvd();
+}
+
 extern unsigned long arch_align_stack(unsigned long sp);
 
 #endif
index 635235fa1e32606c5955653bed40d0a77cb4899c..510c31c50723b93e2c503476350d500a1dbcf503 100644 (file)
@@ -279,6 +279,7 @@ extern void ia64_load_extra (struct task_struct *task);
 #define ia64_platform_is(x) (strcmp(x, platform_name) == 0)
 
 void cpu_idle_wait(void);
+void sched_cacheflush(void);
 
 #define arch_align_stack(x) (x)
 
index dcf619a0a0b03285fd55976f2b0a1fc3ec6c7e49..06c12a037cba557aab39a27eb302adbdf97d67f7 100644 (file)
        last = __last; \
 } while(0)
 
+/*
+ * On SMP systems, when the scheduler does migration-cost autodetection,
+ * it needs a way to flush as much of the CPU's caches as possible.
+ *
+ * TODO: fill this in!
+ */
+static inline void sched_cacheflush(void)
+{
+}
+
 /* Interrupt Control */
 #if !defined(CONFIG_CHIP_M32102) && !defined(CONFIG_CHIP_M32104)
 #define local_irq_enable() \
index 330c4e497af38d248d3ff5e6a8ff584040ffd6f1..5f761ad5a8d9e2fbac584aac44501cbcef10699a 100644 (file)
@@ -164,6 +164,16 @@ do {                                                                       \
                __restore_dsp(current);                                 \
 } while(0)
 
+/*
+ * On SMP systems, when the scheduler does migration-cost autodetection,
+ * it needs a way to flush as much of the CPU's caches as possible.
+ *
+ * TODO: fill this in!
+ */
+static inline void sched_cacheflush(void)
+{
+}
+
 static inline unsigned long __xchg_u32(volatile int * m, unsigned int val)
 {
        __u32 retval;
index f3928d3a80cb01b2afd25569a59fd37e178a4576..a5a973c0c07f55f272d4fccd7c6587f516afff84 100644 (file)
@@ -49,6 +49,15 @@ extern struct task_struct *_switch_to(struct task_struct *, struct task_struct *
        (last) = _switch_to(prev, next);                        \
 } while(0)
 
+/*
+ * On SMP systems, when the scheduler does migration-cost autodetection,
+ * it needs a way to flush as much of the CPU's caches as possible.
+ *
+ * TODO: fill this in!
+ */
+static inline void sched_cacheflush(void)
+{
+}
 
 
 /* interrupt control */
index 0c58e32a9570525ec4a2f036413d4cabfa69c10d..1be629b4fb97bfaa23fa95867bb483366109ee7e 100644 (file)
@@ -175,6 +175,16 @@ struct thread_struct;
 extern struct task_struct *_switch(struct thread_struct *prev,
                                   struct thread_struct *next);
 
+/*
+ * On SMP systems, when the scheduler does migration-cost autodetection,
+ * it needs a way to flush as much of the CPU's caches as possible.
+ *
+ * TODO: fill this in!
+ */
+static inline void sched_cacheflush(void)
+{
+}
+
 extern unsigned int rtas_data;
 extern int mem_init_done;      /* set on boot once kmalloc can be called */
 extern unsigned long memory_limit;
index bd99cb53a19fb512b024e6a184f8f7b3359102ea..212dca66fcac28f7a38fb994149997c58be6e0c5 100644 (file)
@@ -123,6 +123,16 @@ extern struct task_struct *__switch_to(struct task_struct *,
        struct task_struct *);
 #define switch_to(prev, next, last)    ((last) = __switch_to((prev), (next)))
 
+/*
+ * On SMP systems, when the scheduler does migration-cost autodetection,
+ * it needs a way to flush as much of the CPU's caches as possible.
+ *
+ * TODO: fill this in!
+ */
+static inline void sched_cacheflush(void)
+{
+}
+
 struct thread_struct;
 extern struct task_struct *_switch(struct thread_struct *prev,
                                   struct thread_struct *next);
index 864cae7e1fd66382ae919b96ebe781f05fd237e5..c7c3a9ad593f49682a35f3c7cb0d2a28a952cf17 100644 (file)
@@ -104,6 +104,16 @@ static inline void restore_access_regs(unsigned int *acrs)
        prev = __switch_to(prev,next);                                       \
 } while (0)
 
+/*
+ * On SMP systems, when the scheduler does migration-cost autodetection,
+ * it needs a way to flush as much of the CPU's caches as possible.
+ *
+ * TODO: fill this in!
+ */
+static inline void sched_cacheflush(void)
+{
+}
+
 #ifdef CONFIG_VIRT_CPU_ACCOUNTING
 extern void account_user_vtime(struct task_struct *);
 extern void account_system_vtime(struct task_struct *);
index 28a3c2d8bcd7c132afb75f87b16d7a684678500d..bb0330499bdfef3987cc88d7dd454ead0df3a929 100644 (file)
        last = __last;                                                  \
 } while (0)
 
+/*
+ * On SMP systems, when the scheduler does migration-cost autodetection,
+ * it needs a way to flush as much of the CPU's caches as possible.
+ *
+ * TODO: fill this in!
+ */
+static inline void sched_cacheflush(void)
+{
+}
+
 #define nop() __asm__ __volatile__ ("nop")
 
 
index 1f6b71f9e1b637f9c773e26db22dbc26e690402d..52fe2e464e15eead28e27f9dc0b055c013389448 100644 (file)
@@ -165,6 +165,16 @@ extern void fpsave(unsigned long *fpregs, unsigned long *fsr,
          "o0", "o1", "o2", "o3",                   "o7");      \
        } while(0)
 
+/*
+ * On SMP systems, when the scheduler does migration-cost autodetection,
+ * it needs a way to flush as much of the CPU's caches as possible.
+ *
+ * TODO: fill this in!
+ */
+static inline void sched_cacheflush(void)
+{
+}
+
 /*
  * Changing the IRQ level on the Sparc.
  */
index 309f1466b6fa1125edd34f933aa56ab645dc76b0..07d72367f82c9a42a150ace750c0d81ebdd3312c 100644 (file)
@@ -253,6 +253,16 @@ do {       if (test_thread_flag(TIF_PERFCTR)) {                            \
        }                                                               \
 } while(0)
 
+/*
+ * On SMP systems, when the scheduler does migration-cost autodetection,
+ * it needs a way to flush as much of the CPU's caches as possible.
+ *
+ * TODO: fill this in!
+ */
+static inline void sched_cacheflush(void)
+{
+}
+
 static inline unsigned long xchg32(__volatile__ unsigned int *m, unsigned int val)
 {
        unsigned long tmp1, tmp2;
index 38c1e8a69c9c03a91c290d3e004a0d55f85bead9..0eacbefb7dd04aede495c7832af37588df5279ef 100644 (file)
@@ -193,6 +193,15 @@ static inline void write_cr4(unsigned long val)
 #define wbinvd() \
        __asm__ __volatile__ ("wbinvd": : :"memory");
 
+/*
+ * On SMP systems, when the scheduler does migration-cost autodetection,
+ * it needs a way to flush as much of the CPU's caches as possible.
+ */
+static inline void sched_cacheflush(void)
+{
+       wbinvd();
+}
+
 #endif /* __KERNEL__ */
 
 #define nop() __asm__ __volatile__ ("nop")