Re: [PATCH]x86-x86_64 flush cache for CPU hotplug

Zwane Mwaikambo
2005-06-10T19:08:27Z

Hello Shaohua,

On Fri, 10 Jun 2005, Shaohua Li wrote:

> 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?

Interesting, which processor was this?

> Signed-off-by: Shaohua.li<shaohua.li@intel.com>
> ---
>
> 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();

We shouldn't need that mb() there anymore then, ditto for the other
location.