Oleg Nesterov f106eee100 pids: fix fork_idle() to setup ->pids correctly
copy_process(pid => &init_struct_pid) doesn't do attach_pid/etc.

It shouldn't, but this means that the idle threads run with the wrong
pids copied from the caller's task_struct. In x86 case the caller is
either kernel_init() thread or keventd.

In particular, this means that after the series of cpu_up/cpu_down an
idle thread (which never exits) can run with .pid pointing to nowhere.

Change fork_idle() to initialize idle->pids[] correctly. We only set
.pid = &init_struct_pid but do not add .node to list, INIT_TASK() does
the same for the boot-cpu idle thread (swapper).

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Cc: Cedric Le Goater <clg@fr.ibm.com>
Cc: Dave Hansen <haveblue@us.ibm.com>
Cc: Eric Biederman <ebiederm@xmission.com>
Cc: Herbert Poetzl <herbert@13thfloor.at>
Cc: Mathias Krause <Mathias.Krause@secunet.com>
Acked-by: Roland McGrath <roland@redhat.com>
Acked-by: Serge Hallyn <serue@us.ibm.com>
Cc: Sukadev Bhattiprolu <sukadev@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-05-27 09:12:52 -07:00
..
2009-09-21 14:29:21 +02:00
2010-05-18 08:57:00 +10:00
2009-06-24 00:02:38 -04:00
2010-05-19 11:48:18 -07:00
2009-09-18 09:48:52 -07:00
2008-10-16 11:21:30 -07:00
2010-05-11 17:33:42 -07:00
2009-01-14 18:09:02 +01:00
2010-05-11 17:08:24 +02:00
2010-05-17 00:21:03 +02:00
2010-02-10 17:47:17 -08:00
2010-05-11 12:01:10 -07:00
2010-04-02 20:12:05 +02:00
2010-03-12 15:52:32 -08:00
2010-05-24 11:50:38 +02:00
2010-03-06 11:26:23 -08:00
2009-09-23 18:13:10 -07:00
2010-05-21 09:37:29 -07:00
2010-05-10 08:48:39 +02:00
2009-06-18 13:03:55 -07:00