[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>
This commit is contained in:
		
				
					committed by
					
						
						Linus Torvalds
					
				
			
			
				
	
			
			
			
						parent
						
							b0d62e6d5b
						
					
				
				
					commit
					383f2835eb
				
			@@ -2888,6 +2888,7 @@ switch_tasks:
 | 
			
		||||
	if (next == rq->idle)
 | 
			
		||||
		schedstat_inc(rq, sched_goidle);
 | 
			
		||||
	prefetch(next);
 | 
			
		||||
	prefetch_stack(next);
 | 
			
		||||
	clear_tsk_need_resched(prev);
 | 
			
		||||
	rcu_qsctr_inc(task_cpu(prev));
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user