aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/process_64.c
diff options
context:
space:
mode:
authorBrian Gerst <brgerst@gmail.com>2009-01-19 00:38:58 +0900
committerTejun Heo <tj@kernel.org>2009-01-19 00:38:58 +0900
commitc6f5e0acd5d12ee23f701f15889872e67b47caa6 (patch)
treea4613618f06d7519f954745b893b4f572ecd39d9 /arch/x86/kernel/process_64.c
parentx86-64: Move cpu number from PDA to per-cpu and consolidate with 32-bit. (diff)
downloadlinux-dev-c6f5e0acd5d12ee23f701f15889872e67b47caa6.tar.xz
linux-dev-c6f5e0acd5d12ee23f701f15889872e67b47caa6.zip
x86-64: Move current task from PDA to per-cpu and consolidate with 32-bit.
Signed-off-by: Brian Gerst <brgerst@gmail.com> Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'arch/x86/kernel/process_64.c')
-rw-r--r--arch/x86/kernel/process_64.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c
index 416fb9282f4f..e00c31a4b3c0 100644
--- a/arch/x86/kernel/process_64.c
+++ b/arch/x86/kernel/process_64.c
@@ -57,6 +57,9 @@
asmlinkage extern void ret_from_fork(void);
+DEFINE_PER_CPU(struct task_struct *, current_task) = &init_task;
+EXPORT_PER_CPU_SYMBOL(current_task);
+
unsigned long kernel_thread_flags = CLONE_VM | CLONE_UNTRACED;
static ATOMIC_NOTIFIER_HEAD(idle_notifier);
@@ -615,7 +618,7 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
*/
prev->usersp = read_pda(oldrsp);
write_pda(oldrsp, next->usersp);
- write_pda(pcurrent, next_p);
+ percpu_write(current_task, next_p);
write_pda(kernelstack,
(unsigned long)task_stack_page(next_p) +