aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-05-21 22:43:57 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-05-21 22:43:57 -0400
commitbf67f3a5c456a18f2e8d062f7e88506ef2cd9837 (patch)
tree2a2324b2572162059307db82f9238eeb25673a77 /arch/mips
parent226da0dbc84ed97f448523e2a4cb91c27fa68ed9 (diff)
parent203dacbdca977bedaba61ad2fca75d934060a5d5 (diff)
Merge branch 'smp-hotplug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull smp hotplug cleanups from Thomas Gleixner: "This series is merily a cleanup of code copied around in arch/* and not changing any of the real cpu hotplug horrors yet. I wish I'd had something more substantial for 3.5, but I underestimated the lurking horror..." Fix up trivial conflicts in arch/{arm,sparc,x86}/Kconfig and arch/sparc/include/asm/thread_info_32.h * 'smp-hotplug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (79 commits) um: Remove leftover declaration of alloc_task_struct_node() task_allocator: Use config switches instead of magic defines sparc: Use common threadinfo allocator score: Use common threadinfo allocator sh-use-common-threadinfo-allocator mn10300: Use common threadinfo allocator powerpc: Use common threadinfo allocator mips: Use common threadinfo allocator hexagon: Use common threadinfo allocator m32r: Use common threadinfo allocator frv: Use common threadinfo allocator cris: Use common threadinfo allocator x86: Use common threadinfo allocator c6x: Use common threadinfo allocator fork: Provide kmemcache based thread_info allocator tile: Use common threadinfo allocator fork: Provide weak arch_release_[task_struct|thread_info] functions fork: Move thread info gfp flags to header fork: Remove the weak insanity sh: Remove cpu_idle_wait() ...
Diffstat (limited to 'arch/mips')
-rw-r--r--arch/mips/Kconfig1
-rw-r--r--arch/mips/Makefile2
-rw-r--r--arch/mips/include/asm/thread_info.h12
-rw-r--r--arch/mips/kernel/Makefile2
-rw-r--r--arch/mips/kernel/init_task.c35
-rw-r--r--arch/mips/kernel/smp.c56
6 files changed, 5 insertions, 103 deletions
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index ce30e2f91d77..186fc8cf9ee0 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -29,6 +29,7 @@ config MIPS
29 select HAVE_MEMBLOCK 29 select HAVE_MEMBLOCK
30 select HAVE_MEMBLOCK_NODE_MAP 30 select HAVE_MEMBLOCK_NODE_MAP
31 select ARCH_DISCARD_MEMBLOCK 31 select ARCH_DISCARD_MEMBLOCK
32 select GENERIC_SMP_IDLE_THREAD
32 33
33menu "Machine selection" 34menu "Machine selection"
34 35
diff --git a/arch/mips/Makefile b/arch/mips/Makefile
index 4fedf5a51d96..76017c25a9e6 100644
--- a/arch/mips/Makefile
+++ b/arch/mips/Makefile
@@ -235,7 +235,7 @@ endif
235 235
236OBJCOPYFLAGS += --remove-section=.reginfo 236OBJCOPYFLAGS += --remove-section=.reginfo
237 237
238head-y := arch/mips/kernel/head.o arch/mips/kernel/init_task.o 238head-y := arch/mips/kernel/head.o
239 239
240libs-y += arch/mips/lib/ 240libs-y += arch/mips/lib/
241 241
diff --git a/arch/mips/include/asm/thread_info.h b/arch/mips/include/asm/thread_info.h
index 0d85d8e440c5..e2eca7d10598 100644
--- a/arch/mips/include/asm/thread_info.h
+++ b/arch/mips/include/asm/thread_info.h
@@ -85,18 +85,6 @@ register struct thread_info *__current_thread_info __asm__("$28");
85 85
86#define STACK_WARN (THREAD_SIZE / 8) 86#define STACK_WARN (THREAD_SIZE / 8)
87 87
88#define __HAVE_ARCH_THREAD_INFO_ALLOCATOR
89
90#ifdef CONFIG_DEBUG_STACK_USAGE
91#define alloc_thread_info_node(tsk, node) \
92 kzalloc_node(THREAD_SIZE, GFP_KERNEL, node)
93#else
94#define alloc_thread_info_node(tsk, node) \
95 kmalloc_node(THREAD_SIZE, GFP_KERNEL, node)
96#endif
97
98#define free_thread_info(info) kfree(info)
99
100#endif /* !__ASSEMBLY__ */ 88#endif /* !__ASSEMBLY__ */
101 89
102#define PREEMPT_ACTIVE 0x10000000 90#define PREEMPT_ACTIVE 0x10000000
diff --git a/arch/mips/kernel/Makefile b/arch/mips/kernel/Makefile
index 0c6877ea9004..fdaf65e1a99d 100644
--- a/arch/mips/kernel/Makefile
+++ b/arch/mips/kernel/Makefile
@@ -2,7 +2,7 @@
2# Makefile for the Linux/MIPS kernel. 2# Makefile for the Linux/MIPS kernel.
3# 3#
4 4
5extra-y := head.o init_task.o vmlinux.lds 5extra-y := head.o vmlinux.lds
6 6
7obj-y += cpu-probe.o branch.o entry.o genex.o irq.o process.o \ 7obj-y += cpu-probe.o branch.o entry.o genex.o irq.o process.o \
8 ptrace.o reset.o setup.o signal.o syscall.o \ 8 ptrace.o reset.o setup.o signal.o syscall.o \
diff --git a/arch/mips/kernel/init_task.c b/arch/mips/kernel/init_task.c
deleted file mode 100644
index 5f9a76263c9a..000000000000
--- a/arch/mips/kernel/init_task.c
+++ /dev/null
@@ -1,35 +0,0 @@
1#include <linux/mm.h>
2#include <linux/export.h>
3#include <linux/sched.h>
4#include <linux/init_task.h>
5#include <linux/fs.h>
6#include <linux/mqueue.h>
7
8#include <asm/thread_info.h>
9#include <asm/uaccess.h>
10#include <asm/pgtable.h>
11
12static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
13static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
14/*
15 * Initial thread structure.
16 *
17 * We need to make sure that this is 8192-byte aligned due to the
18 * way process stacks are handled. This is done by making sure
19 * the linker maps this in the .text segment right after head.S,
20 * and making head.S ensure the proper alignment.
21 *
22 * The things we do for performance..
23 */
24union thread_union init_thread_union __init_task_data
25 __attribute__((__aligned__(THREAD_SIZE))) =
26 { INIT_THREAD_INFO(init_task) };
27
28/*
29 * Initial task structure.
30 *
31 * All other task structs will be allocated on slabs in fork.c
32 */
33struct task_struct init_task = INIT_TASK(init_task);
34
35EXPORT_SYMBOL(init_task);
diff --git a/arch/mips/kernel/smp.c b/arch/mips/kernel/smp.c
index ba9376bf52a1..71a95f55a649 100644
--- a/arch/mips/kernel/smp.c
+++ b/arch/mips/kernel/smp.c
@@ -186,61 +186,9 @@ void __devinit smp_prepare_boot_cpu(void)
186 cpu_set(0, cpu_callin_map); 186 cpu_set(0, cpu_callin_map);
187} 187}
188 188
189/* 189int __cpuinit __cpu_up(unsigned int cpu, struct task_struct *tidle)
190 * Called once for each "cpu_possible(cpu)". Needs to spin up the cpu
191 * and keep control until "cpu_online(cpu)" is set. Note: cpu is
192 * physical, not logical.
193 */
194static struct task_struct *cpu_idle_thread[NR_CPUS];
195
196struct create_idle {
197 struct work_struct work;
198 struct task_struct *idle;
199 struct completion done;
200 int cpu;
201};
202
203static void __cpuinit do_fork_idle(struct work_struct *work)
204{
205 struct create_idle *c_idle =
206 container_of(work, struct create_idle, work);
207
208 c_idle->idle = fork_idle(c_idle->cpu);
209 complete(&c_idle->done);
210}
211
212int __cpuinit __cpu_up(unsigned int cpu)
213{ 190{
214 struct task_struct *idle; 191 mp_ops->boot_secondary(cpu, tidle);
215
216 /*
217 * Processor goes to start_secondary(), sets online flag
218 * The following code is purely to make sure
219 * Linux can schedule processes on this slave.
220 */
221 if (!cpu_idle_thread[cpu]) {
222 /*
223 * Schedule work item to avoid forking user task
224 * Ported from arch/x86/kernel/smpboot.c
225 */
226 struct create_idle c_idle = {
227 .cpu = cpu,
228 .done = COMPLETION_INITIALIZER_ONSTACK(c_idle.done),
229 };
230
231 INIT_WORK_ONSTACK(&c_idle.work, do_fork_idle);
232 schedule_work(&c_idle.work);
233 wait_for_completion(&c_idle.done);
234 idle = cpu_idle_thread[cpu] = c_idle.idle;
235
236 if (IS_ERR(idle))
237 panic(KERN_ERR "Fork failed for CPU %d", cpu);
238 } else {
239 idle = cpu_idle_thread[cpu];
240 init_idle(idle, cpu);
241 }
242
243 mp_ops->boot_secondary(cpu, idle);
244 192
245 /* 193 /*
246 * Trust is futile. We should really have timeouts ... 194 * Trust is futile. We should really have timeouts ...