]> git.baikalelectronics.ru Git - kernel.git/commit
rcu: Prevent initialization race in rcutorture kthreads
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Sat, 25 Aug 2012 22:27:40 +0000 (15:27 -0700)
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Sun, 23 Sep 2012 14:42:23 +0000 (07:42 -0700)
commitf54f0854b152575f3def6b2e9db189792b6b8d4b
treedaf20b20a35f09ecfa214127cf3c676f12c4edd1
parent76480c5f50c6785f28d833ebe86b74087d4190fb
rcu: Prevent initialization race in rcutorture kthreads

When you do something like "t = kthread_run(...)", it is possible that
the kthread will start running before the assignment to "t" happens.
If the child kthread expects to find a pointer to its task_struct in "t",
it will then be fatally disappointed.  This commit therefore switches
such cases to kthread_create() followed by wake_up_process(), guaranteeing
that the assignment happens before the child kthread starts running.

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
kernel/rcutorture.c