Re: invalidate caches before going into suspend

From: Andi Kleen
Date: Wed Aug 13 2008 - 15:39:42 EST


Mark Langsdorf <mark.langsdorf@xxxxxxx> writes:
> @@ -93,11 +93,11 @@ static inline void play_dead(void)
> static inline void play_dead(void)
> {
> idle_task_exit();
> - wbinvd();
> mb();
> /* Ack it */
> __get_cpu_var(cpu_state) = CPU_DEAD;
>
> + wbinvd();

You should put the mb() (or just a barrier()) directly above the wbinvd(),
otherwise the compiler is free to reorder this behind your back again
and move the store down after the wbinvd.

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