[PATCH]x86-x86_64 flush cache for CPU hotplug

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

 



Hi,
We should flush cache at CPU hotplug. An error has been observed data is
corrupted after CPU hotplug in CPUs with bigger cache.
I guess IA64 requires similar change, Ashok?

Thanks,
Shaohua

Signed-off-by: Shaohua.li<[email protected]>
---

 linux-2.6.12-rc6-mm1-root/arch/i386/kernel/process.c   |    1 +
 linux-2.6.12-rc6-mm1-root/arch/x86_64/kernel/process.c |    1 +
 2 files changed, 2 insertions(+)

diff -puN arch/i386/kernel/process.c~flush_cache_cpuhotplug arch/i386/kernel/process.c
--- linux-2.6.12-rc6-mm1/arch/i386/kernel/process.c~flush_cache_cpuhotplug	2005-06-10 10:56:05.082247160 +0800
+++ linux-2.6.12-rc6-mm1-root/arch/i386/kernel/process.c	2005-06-10 11:05:10.597316264 +0800
@@ -155,6 +155,7 @@ static inline void play_dead(void)
 {
 	/* This must be done before dead CPU ack */
 	cpu_exit_clear();
+	wbinvd();
 	mb();
 	/* Ack it */
 	__get_cpu_var(cpu_state) = CPU_DEAD;
diff -puN arch/x86_64/kernel/process.c~flush_cache_cpuhotplug arch/x86_64/kernel/process.c
--- linux-2.6.12-rc6-mm1/arch/x86_64/kernel/process.c~flush_cache_cpuhotplug	2005-06-10 10:56:18.270242280 +0800
+++ linux-2.6.12-rc6-mm1-root/arch/x86_64/kernel/process.c	2005-06-10 11:05:23.206399392 +0800
@@ -165,6 +165,7 @@ DECLARE_PER_CPU(int, cpu_state);
 static inline void play_dead(void)
 {
 	idle_task_exit();
+	wbinvd();
 	mb();
 	/* Ack it */
 	__get_cpu_var(cpu_state) = CPU_DEAD;
_


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux