Skip to contentSkip to conversation

sched: Fix 32bit race

PATCH In review Peter Zijlstra 3 participants 3 messages Jul 12, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sched: Fix 32bit race

Ingo, can we get the below patch into sched/urgent and towards Linus before he cuts a release?

I'm surprised there weren't more 32bit-smp doesn't boot for me complaints, either Bruno is a very 'lucky' man, or nobody is using 32bit kernels any more since he was hitting this quite reliably.

---
Subject: sched: Fix 32bit race
From: Peter Zijlstra <[email protected]>
Date: Mon Jul 11 16:28:50 CEST 2011

Commit 3fe1698b7fe0 ("sched: Deal with non-atomic min_vruntime reads on 32bit") forgot to initialize min_vruntime_copy which could lead to an infinite while loop in task_waking_fair() under some circumstances (early boot, lucky timing).

---

kernel/sched.c +3 -0
Index: linux-2.6/kernel/sched.c
===================================================================
@@ -7750,6 +7750,9 @@ static void init_cfs_rq(struct cfs_rq *c
 #endif
 #endif
 	cfs_rq->min_vruntime = (u64)(-(1LL << 20));
+#ifndef CONFIG_64BIT
+	cfs_rq->min_vruntime_copy = cfs_rq->min_vruntime;
+#endif
 }
 
 static void init_rt_rq(struct rt_rq *rt_rq, struct rq *rq)
#1 lore raw
Quoted 6 lines · Peter Zijlstra

Ingo, can we get the below patch into sched/urgent and towards Linus before he cuts a release?

I'm surprised there weren't more 32bit-smp doesn't boot for me complaints, either Bruno is a very 'lucky' man, or nobody is using 32bit kernels any more since he was hitting this quite reliably.

On two different machines. Both an Athlon MP and an old Xeon were hitting this problem on every boot.

Reviewed-by on v1 1/1
#2 lore raw
In reply to Peter Zijlstra
Quoted 6 lines · Peter Zijlstra

Ingo, can we get the below patch into sched/urgent and towards Linus before he cuts a release?

I'm surprised there weren't more 32bit-smp doesn't boot for me complaints, either Bruno is a very 'lucky' man, or nobody is using 32bit kernels any more since he was hitting this quite reliably.

It appears that there have been several, but they were blaming RCU instead. ;-)

Quoted 9 lines

---
Subject: sched: Fix 32bit race
From: Peter Zijlstra <[email protected]>
Date: Mon Jul 11 16:28:50 CEST 2011

Commit 3fe1698b7fe0 ("sched: Deal with non-atomic min_vruntime reads on 32bit") forgot to initialize min_vruntime_copy which could lead to an infinite while loop in task_waking_fair() under some circumstances (early boot, lucky timing).

Quoted 24 lines

---
Index: linux-2.6/kernel/sched.c
===================================================================

kernel/sched.c +3 -1
@@ -7750,6 +7750,9 @@ static void init_cfs_rq(struct cfs_rq *c
 #endif
 #endif
 	cfs_rq->min_vruntime = (u64)(-(1LL << 20));
+#ifndef CONFIG_64BIT
+	cfs_rq->min_vruntime_copy = cfs_rq->min_vruntime;
+#endif
 }
 
 static void init_rt_rq(struct rt_rq *rt_rq, struct rq *rq)
 
--

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/