aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorChen, Kenneth W <kenneth.w.chen@intel.com>2005-09-09 16:02:02 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-09-09 16:57:31 -0400
commit383f2835eb9afb723af71850037b2f074ac9db60 (patch)
tree1ef99fd4d7246b2afa16dc7d1514b6ff25fa8284 /kernel
parentb0d62e6d5b3318b6b722121d945afa295f7201b5 (diff)
[PATCH] Prefetch kernel stacks to speed up context switch
For architecture like ia64, the switch stack structure is fairly large (currently 528 bytes). For context switch intensive application, we found that significant amount of cache misses occurs in switch_to() function. The following patch adds a hook in the schedule() function to prefetch switch stack structure as soon as 'next' task is determined. This allows maximum overlap in prefetch cache lines for that structure. Signed-off-by: Ken Chen <kenneth.w.chen@intel.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: "Luck, Tony" <tony.luck@intel.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/sched.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/kernel/sched.c b/kernel/sched.c
index 18b95520a2e2..2632b812cf24 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -2888,6 +2888,7 @@ switch_tasks:
2888 if (next == rq->idle) 2888 if (next == rq->idle)
2889 schedstat_inc(rq, sched_goidle); 2889 schedstat_inc(rq, sched_goidle);
2890 prefetch(next); 2890 prefetch(next);
2891 prefetch_stack(next);
2891 clear_tsk_need_resched(prev); 2892 clear_tsk_need_resched(prev);
2892 rcu_qsctr_inc(task_cpu(prev)); 2893 rcu_qsctr_inc(task_cpu(prev));
2893 2894