All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sched: Fix 32bit race
@ 2011-07-12 12:07 Peter Zijlstra
  2011-07-12 12:34 ` Bruno Wolff III
  2011-07-12 20:09 ` Paul E. McKenney
  0 siblings, 2 replies; 3+ messages in thread
From: Peter Zijlstra @ 2011-07-12 12:07 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: Linus Torvalds, linux-kernel, Mike Galbraith, bruno

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 <a.p.zijlstra@chello.nl>
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).

Reported-and-tested-by: Bruno Wolff III <bruno@wolff.to>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
---
Index: linux-2.6/kernel/sched.c
===================================================================
--- linux-2.6.orig/kernel/sched.c
+++ 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)


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] sched: Fix 32bit race
  2011-07-12 12:07 [PATCH] sched: Fix 32bit race Peter Zijlstra
@ 2011-07-12 12:34 ` Bruno Wolff III
  2011-07-12 20:09 ` Paul E. McKenney
  1 sibling, 0 replies; 3+ messages in thread
From: Bruno Wolff III @ 2011-07-12 12:34 UTC (permalink / raw)
  To: Peter Zijlstra; +Cc: Ingo Molnar, Linus Torvalds, linux-kernel, Mike Galbraith

On Tue, Jul 12, 2011 at 14:07:14 +0200,
  Peter Zijlstra <a.p.zijlstra@chello.nl> wrote:
> 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.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] sched: Fix 32bit race
  2011-07-12 12:07 [PATCH] sched: Fix 32bit race Peter Zijlstra
  2011-07-12 12:34 ` Bruno Wolff III
@ 2011-07-12 20:09 ` Paul E. McKenney
  1 sibling, 0 replies; 3+ messages in thread
From: Paul E. McKenney @ 2011-07-12 20:09 UTC (permalink / raw)
  To: Peter Zijlstra
  Cc: Ingo Molnar, Linus Torvalds, linux-kernel, Mike Galbraith, bruno

On Tue, Jul 12, 2011 at 02:07:14PM +0200, Peter Zijlstra wrote:
> 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.  ;-)

> ---
> Subject: sched: Fix 32bit race
> From: Peter Zijlstra <a.p.zijlstra@chello.nl>
> 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).

Reviewed-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>

> Reported-and-tested-by: Bruno Wolff III <bruno@wolff.to>
> Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
> ---
> Index: linux-2.6/kernel/sched.c
> ===================================================================
> --- linux-2.6.orig/kernel/sched.c
> +++ 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)
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-07-12 20:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-12 12:07 [PATCH] sched: Fix 32bit race Peter Zijlstra
2011-07-12 12:34 ` Bruno Wolff III
2011-07-12 20:09 ` Paul E. McKenney

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.