diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-05-21 22:43:57 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-05-21 22:43:57 -0400 |
commit | bf67f3a5c456a18f2e8d062f7e88506ef2cd9837 (patch) | |
tree | 2a2324b2572162059307db82f9238eeb25673a77 /arch/tile | |
parent | 226da0dbc84ed97f448523e2a4cb91c27fa68ed9 (diff) | |
parent | 203dacbdca977bedaba61ad2fca75d934060a5d5 (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/tile')
-rw-r--r-- | arch/tile/include/asm/thread_info.h | 6 | ||||
-rw-r--r-- | arch/tile/kernel/Makefile | 2 | ||||
-rw-r--r-- | arch/tile/kernel/init_task.c | 59 | ||||
-rw-r--r-- | arch/tile/kernel/process.c | 23 | ||||
-rw-r--r-- | arch/tile/kernel/setup.c | 16 | ||||
-rw-r--r-- | arch/tile/kernel/smpboot.c | 2 |
6 files changed, 22 insertions, 86 deletions
diff --git a/arch/tile/include/asm/thread_info.h b/arch/tile/include/asm/thread_info.h index 7594764d8a69..656c486e64fa 100644 --- a/arch/tile/include/asm/thread_info.h +++ b/arch/tile/include/asm/thread_info.h | |||
@@ -77,16 +77,14 @@ struct thread_info { | |||
77 | 77 | ||
78 | #ifndef __ASSEMBLY__ | 78 | #ifndef __ASSEMBLY__ |
79 | 79 | ||
80 | void arch_release_thread_info(struct thread_info *info); | ||
81 | |||
80 | /* How to get the thread information struct from C. */ | 82 | /* How to get the thread information struct from C. */ |
81 | register unsigned long stack_pointer __asm__("sp"); | 83 | register unsigned long stack_pointer __asm__("sp"); |
82 | 84 | ||
83 | #define current_thread_info() \ | 85 | #define current_thread_info() \ |
84 | ((struct thread_info *)(stack_pointer & -THREAD_SIZE)) | 86 | ((struct thread_info *)(stack_pointer & -THREAD_SIZE)) |
85 | 87 | ||
86 | #define __HAVE_ARCH_THREAD_INFO_ALLOCATOR | ||
87 | extern struct thread_info *alloc_thread_info_node(struct task_struct *task, int node); | ||
88 | extern void free_thread_info(struct thread_info *info); | ||
89 | |||
90 | /* Sit on a nap instruction until interrupted. */ | 88 | /* Sit on a nap instruction until interrupted. */ |
91 | extern void smp_nap(void); | 89 | extern void smp_nap(void); |
92 | 90 | ||
diff --git a/arch/tile/kernel/Makefile b/arch/tile/kernel/Makefile index b4dbc057baad..0d826faf8f35 100644 --- a/arch/tile/kernel/Makefile +++ b/arch/tile/kernel/Makefile | |||
@@ -3,7 +3,7 @@ | |||
3 | # | 3 | # |
4 | 4 | ||
5 | extra-y := vmlinux.lds head_$(BITS).o | 5 | extra-y := vmlinux.lds head_$(BITS).o |
6 | obj-y := backtrace.o entry.o init_task.o irq.o messaging.o \ | 6 | obj-y := backtrace.o entry.o irq.o messaging.o \ |
7 | pci-dma.o proc.o process.o ptrace.o reboot.o \ | 7 | pci-dma.o proc.o process.o ptrace.o reboot.o \ |
8 | setup.o signal.o single_step.o stack.o sys.o sysfs.o time.o traps.o \ | 8 | setup.o signal.o single_step.o stack.o sys.o sysfs.o time.o traps.o \ |
9 | intvec_$(BITS).o regs_$(BITS).o tile-desc_$(BITS).o | 9 | intvec_$(BITS).o regs_$(BITS).o tile-desc_$(BITS).o |
diff --git a/arch/tile/kernel/init_task.c b/arch/tile/kernel/init_task.c deleted file mode 100644 index 928b31870669..000000000000 --- a/arch/tile/kernel/init_task.c +++ /dev/null | |||
@@ -1,59 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright 2010 Tilera Corporation. All Rights Reserved. | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or | ||
5 | * modify it under the terms of the GNU General Public License | ||
6 | * as published by the Free Software Foundation, version 2. | ||
7 | * | ||
8 | * This program is distributed in the hope that it will be useful, but | ||
9 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
10 | * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or | ||
11 | * NON INFRINGEMENT. See the GNU General Public License for | ||
12 | * more details. | ||
13 | */ | ||
14 | |||
15 | #include <linux/mm.h> | ||
16 | #include <linux/fs.h> | ||
17 | #include <linux/init_task.h> | ||
18 | #include <linux/mqueue.h> | ||
19 | #include <linux/module.h> | ||
20 | #include <linux/start_kernel.h> | ||
21 | #include <linux/uaccess.h> | ||
22 | |||
23 | static struct signal_struct init_signals = INIT_SIGNALS(init_signals); | ||
24 | static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand); | ||
25 | |||
26 | /* | ||
27 | * Initial thread structure. | ||
28 | * | ||
29 | * We need to make sure that this is THREAD_SIZE aligned due to the | ||
30 | * way process stacks are handled. This is done by having a special | ||
31 | * "init_task" linker map entry.. | ||
32 | */ | ||
33 | union thread_union init_thread_union __init_task_data = { | ||
34 | INIT_THREAD_INFO(init_task) | ||
35 | }; | ||
36 | |||
37 | /* | ||
38 | * Initial task structure. | ||
39 | * | ||
40 | * All other task structs will be allocated on slabs in fork.c | ||
41 | */ | ||
42 | struct task_struct init_task = INIT_TASK(init_task); | ||
43 | EXPORT_SYMBOL(init_task); | ||
44 | |||
45 | /* | ||
46 | * per-CPU stack and boot info. | ||
47 | */ | ||
48 | DEFINE_PER_CPU(unsigned long, boot_sp) = | ||
49 | (unsigned long)init_stack + THREAD_SIZE; | ||
50 | |||
51 | #ifdef CONFIG_SMP | ||
52 | DEFINE_PER_CPU(unsigned long, boot_pc) = (unsigned long)start_kernel; | ||
53 | #else | ||
54 | /* | ||
55 | * The variable must be __initdata since it references __init code. | ||
56 | * With CONFIG_SMP it is per-cpu data, which is exempt from validation. | ||
57 | */ | ||
58 | unsigned long __initdata boot_pc = (unsigned long)start_kernel; | ||
59 | #endif | ||
diff --git a/arch/tile/kernel/process.c b/arch/tile/kernel/process.c index 54e6c64b85cc..f572c19c4082 100644 --- a/arch/tile/kernel/process.c +++ b/arch/tile/kernel/process.c | |||
@@ -114,27 +114,10 @@ void cpu_idle(void) | |||
114 | } | 114 | } |
115 | } | 115 | } |
116 | 116 | ||
117 | struct thread_info *alloc_thread_info_node(struct task_struct *task, int node) | ||
118 | { | ||
119 | struct page *page; | ||
120 | gfp_t flags = GFP_KERNEL; | ||
121 | |||
122 | #ifdef CONFIG_DEBUG_STACK_USAGE | ||
123 | flags |= __GFP_ZERO; | ||
124 | #endif | ||
125 | |||
126 | page = alloc_pages_node(node, flags, THREAD_SIZE_ORDER); | ||
127 | if (!page) | ||
128 | return NULL; | ||
129 | |||
130 | return (struct thread_info *)page_address(page); | ||
131 | } | ||
132 | |||
133 | /* | 117 | /* |
134 | * Free a thread_info node, and all of its derivative | 118 | * Release a thread_info structure |
135 | * data structures. | ||
136 | */ | 119 | */ |
137 | void free_thread_info(struct thread_info *info) | 120 | void arch_release_thread_info(struct thread_info *info) |
138 | { | 121 | { |
139 | struct single_step_state *step_state = info->step_state; | 122 | struct single_step_state *step_state = info->step_state; |
140 | 123 | ||
@@ -169,8 +152,6 @@ void free_thread_info(struct thread_info *info) | |||
169 | */ | 152 | */ |
170 | kfree(step_state); | 153 | kfree(step_state); |
171 | } | 154 | } |
172 | |||
173 | free_pages((unsigned long)info, THREAD_SIZE_ORDER); | ||
174 | } | 155 | } |
175 | 156 | ||
176 | static void save_arch_state(struct thread_struct *t); | 157 | static void save_arch_state(struct thread_struct *t); |
diff --git a/arch/tile/kernel/setup.c b/arch/tile/kernel/setup.c index bff23f476110..98d80eb49ddb 100644 --- a/arch/tile/kernel/setup.c +++ b/arch/tile/kernel/setup.c | |||
@@ -61,6 +61,22 @@ unsigned long __initdata node_free_pfn[MAX_NUMNODES]; | |||
61 | 61 | ||
62 | static unsigned long __initdata node_percpu[MAX_NUMNODES]; | 62 | static unsigned long __initdata node_percpu[MAX_NUMNODES]; |
63 | 63 | ||
64 | /* | ||
65 | * per-CPU stack and boot info. | ||
66 | */ | ||
67 | DEFINE_PER_CPU(unsigned long, boot_sp) = | ||
68 | (unsigned long)init_stack + THREAD_SIZE; | ||
69 | |||
70 | #ifdef CONFIG_SMP | ||
71 | DEFINE_PER_CPU(unsigned long, boot_pc) = (unsigned long)start_kernel; | ||
72 | #else | ||
73 | /* | ||
74 | * The variable must be __initdata since it references __init code. | ||
75 | * With CONFIG_SMP it is per-cpu data, which is exempt from validation. | ||
76 | */ | ||
77 | unsigned long __initdata boot_pc = (unsigned long)start_kernel; | ||
78 | #endif | ||
79 | |||
64 | #ifdef CONFIG_HIGHMEM | 80 | #ifdef CONFIG_HIGHMEM |
65 | /* Page frame index of end of lowmem on each controller. */ | 81 | /* Page frame index of end of lowmem on each controller. */ |
66 | unsigned long __cpuinitdata node_lowmem_end_pfn[MAX_NUMNODES]; | 82 | unsigned long __cpuinitdata node_lowmem_end_pfn[MAX_NUMNODES]; |
diff --git a/arch/tile/kernel/smpboot.c b/arch/tile/kernel/smpboot.c index 172aef7d3159..84873fbe8f27 100644 --- a/arch/tile/kernel/smpboot.c +++ b/arch/tile/kernel/smpboot.c | |||
@@ -222,7 +222,7 @@ void __cpuinit online_secondary(void) | |||
222 | cpu_idle(); | 222 | cpu_idle(); |
223 | } | 223 | } |
224 | 224 | ||
225 | int __cpuinit __cpu_up(unsigned int cpu) | 225 | int __cpuinit __cpu_up(unsigned int cpu, struct task_struct *tidle) |
226 | { | 226 | { |
227 | /* Wait 5s total for all CPUs for them to come online */ | 227 | /* Wait 5s total for all CPUs for them to come online */ |
228 | static int timeout; | 228 | static int timeout; |