@@ -195,6 +195,21 @@ exit_idle:
DEFINE_PER_CPU(bool, cpu_dead_idle);
+#define NR_STACK_ELEMS 128
+static noinline void hit_stale_poison(unsigned int frames)
+{
+ volatile unsigned long magic[NR_STACK_ELEMS];
+ int i;
+
+ for (i = 0; i < NR_STACK_ELEMS; i++)
+ magic[i] = 0;
+
+ if (frames)
+ hit_stale_poison(frames - 1);
+
+ return;
+}
+
/*
* Generic idle loop implementation
*
@@ -202,6 +217,8 @@ DEFINE_PER_CPU(bool, cpu_dead_idle);
*/
static void cpu_idle_loop(void)
{
+ hit_stale_poison(4);
+
while (1) {
/*
* If the arch has a polling bit, we maintain an invariant: