]> git.karo-electronics.de Git - karo-tx-linux.git/commit
init, sched: Fix race between init and kthreadd
authorPeter Zijlstra <peterz@infradead.org>
Mon, 28 Jun 2010 14:51:01 +0000 (16:51 +0200)
committerPaul Gortmaker <paul.gortmaker@windriver.com>
Wed, 14 Mar 2012 14:57:48 +0000 (10:57 -0400)
commit669cea470cfee2c9f5b9759cc1069358130b7710
tree351b96d803a37e0b5c08b370cc764c335321177b
parent7acbd73c63f2ace317abef386fd2568bfc28b82e
init, sched: Fix race between init and kthreadd

commit b433c3d4549ae74935b585115f076c6fb7bc48fe upstream.

Ilya reported that on a very slow machine he could reliably
reproduce a race between forking init and kthreadd. We first
fork init so that it  obtains pid-1, however since the scheduler
is already fully running at this point it can preempt and run
the init thread before we spawn and set kthreadd_task.

The init thread can then attempt spawning kthreads without
kthreadd being present which results in an OOPS.

Reported-by: Ilya Loginov <isloginov@gmail.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
LKML-Reference: <1277736661.3561.110.camel@laptop>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
init/main.c