Nathan Lynch f756d5e256 [PATCH] fix workqueue oops during cpu offline
Use first_cpu(cpu_possible_map) for the single-thread workqueue case.  We
used to hardcode 0, but that broke on systems where !cpu_possible(0) when
workqueue_struct->cpu_workqueue_struct was changed from a static array to
alloc_percpu.

Commit id bce61dd49d6ba7799be2de17c772e4c701558f14 ("Fix hardcoded cpu=0 in
workqueue for per_cpu_ptr() calls") fixed that for Ben's funky sparc64
system, but it regressed my Power5.  Offlining cpu 0 oopses upon the next
call to queue_work for a single-thread workqueue, because now we try to
manipulate per_cpu_ptr(wq->cpu_wq, 1), which is uninitialized.

So we need to establish an unchanging "slot" for single-thread workqueues
which will have a valid percpu allocation.  Since alloc_percpu keys off of
cpu_possible_map, which must not change after initialization, make this
slot == first_cpu(cpu_possible_map).

Signed-off-by: Nathan Lynch <ntl@pobox.com>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-01-08 20:14:08 -08:00
..
2006-01-08 20:13:48 -08:00
2006-01-06 08:33:49 -08:00
2006-01-08 20:13:48 -08:00
2005-10-28 08:16:49 -07:00
2006-01-08 20:13:58 -08:00
2005-04-16 15:20:36 -07:00
2005-04-16 15:20:36 -07:00
2005-04-16 15:20:36 -07:00
2005-07-27 16:25:51 -07:00
2005-10-30 17:37:32 -08:00
2005-10-29 21:40:42 -07:00
2005-10-08 15:00:57 -07:00
2005-10-30 17:37:17 -08:00
2006-01-06 08:33:53 -08:00
2006-01-08 20:13:40 -08:00
2006-01-08 20:13:52 -08:00
2005-07-07 18:23:46 -07:00
2005-09-07 16:57:45 -07:00
2006-01-08 20:13:40 -08:00
2005-04-16 15:20:36 -07:00
2005-09-10 10:06:21 -07:00
2005-12-12 08:57:42 -08:00
2006-01-08 20:13:48 -08:00
2005-04-16 15:20:36 -07:00
2005-07-12 20:38:38 -07:00
2005-04-16 15:20:36 -07:00