[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20080813173115.GA28891@elte.hu>
Date: Wed, 13 Aug 2008 19:31:15 +0200
From: Ingo Molnar <mingo@...e.hu>
To: Mark Langsdorf <mark.langsdorf@....com>
Cc: linux-kernel@...r.kernel.org,
Linus Torvalds <torvalds@...ux-foundation.org>,
Thomas Gleixner <tglx@...utronix.de>,
"H. Peter Anvin" <hpa@...or.com>
Subject: Re: [PATCH][retry 1] 2.6.27-rc2: invalidate caches before going
into suspend
(please keep Cc:s intact)
* Mark Langsdorf <mark.langsdorf@....com> wrote:
> @@ -104,6 +103,7 @@ static inline void play_dead(void)
> * With physical CPU hotplug, we should halt the cpu
> */
> local_irq_disable();
> + wbinvd();
> while (1)
> halt();
hm, why not do what i suggested in my first mail:
if (cpu >= i486)
asm("cli; wbinvd; cli; 1: hlt; jmp 1b")
else
halt();
perhaps turn it into a wbivd_halt() primitive, to make it clean and even
more obvious.
This sequence does matter to reliable suspend/resume, and in theory gcc
could insert something before a halt() as well.
[ i only have a pretty far-fetched example that in all likelyhood wont
happen in practice: for example halt could be decided to be uninlined
by a braindead compiler, ftrace could hook in there, and dirty some
state. But still - the point is that we had a difficult bug in this
code for a long time and in such situations we should just over-do
robustness by default. ]
Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists