]> bbs.cooldavid.org Git - net-next-2.6.git/commit
x86, percpu: Collect hot percpu variables into one cacheline
authorTejun Heo <tj@kernel.org>
Mon, 3 Aug 2009 05:12:19 +0000 (14:12 +0900)
committerTejun Heo <tj@kernel.org>
Mon, 3 Aug 2009 16:29:34 +0000 (01:29 +0900)
commitbdf977b37418cdf8a2252504779a7e12a09b7575
tree0f3896a5b39c35f3018d3cb16f797ae7d6c4a66b
parent3e352aa8ee2bd48f1a19c7742810b3a4a7ba605e
x86, percpu: Collect hot percpu variables into one cacheline

On x86_64, percpu variables current_task and kernel_stack are used for
get_current() and current_thread_info() respectively and thus are
often used close to each other.  Move definition of current_task to
kernel/cpu/common.c right above kernel_stack definition and align it
to cacheline so that they always fall into the same cacheline.  Two
percpu variables defined there together - irq_stack_ptr and irq_count
- are also pretty hot and will benefit from sharing the cacheline.

For consistency, current_task definition for x86_32 is also moved to
kernel/cpu/common.c.

Putting current_task and kernel_stack into the same cacheline was
suggested by Linus Torvalds.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
arch/x86/kernel/cpu/common.c
arch/x86/kernel/process_32.c
arch/x86/kernel/process_64.c