aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/sched.h
diff options
context:
space:
mode:
authorPeter Zijlstra <a.p.zijlstra@chello.nl>2011-04-05 11:23:58 -0400
committerIngo Molnar <mingo@elte.hu>2011-04-14 02:52:41 -0400
commit317f394160e9beb97d19a84c39b7e5eb3d7815a8 (patch)
tree486f268e9ec010744c17333f0f543da9d3909ff4 /include/linux/sched.h
parentc05fbafba1c5482bee399b360288fa405415e126 (diff)
sched: Move the second half of ttwu() to the remote cpu
Now that we've removed the rq->lock requirement from the first part of ttwu() and can compute placement without holding any rq->lock, ensure we execute the second half of ttwu() on the actual cpu we want the task to run on. This avoids having to take rq->lock and doing the task enqueue remotely, saving lots on cacheline transfers. As measured using: http://oss.oracle.com/~mason/sembench.c $ for i in /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor ; do echo performance > $i; done $ echo 4096 32000 64 128 > /proc/sys/kernel/sem $ ./sembench -t 2048 -w 1900 -o 0 unpatched: run time 30 seconds 647278 worker burns per second patched: run time 30 seconds 816715 worker burns per second Reviewed-by: Frank Rowand <frank.rowand@am.sony.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Nick Piggin <npiggin@kernel.dk> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/20110405152729.515897185@chello.nl
Diffstat (limited to 'include/linux/sched.h')
-rw-r--r--include/linux/sched.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 25c50317ddc1..e09dafa6e149 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1203,6 +1203,7 @@ struct task_struct {
1203 int lock_depth; /* BKL lock depth */ 1203 int lock_depth; /* BKL lock depth */
1204 1204
1205#ifdef CONFIG_SMP 1205#ifdef CONFIG_SMP
1206 struct task_struct *wake_entry;
1206 int on_cpu; 1207 int on_cpu;
1207#endif 1208#endif
1208 int on_rq; 1209 int on_rq;
@@ -2192,7 +2193,7 @@ extern void set_task_comm(struct task_struct *tsk, char *from);
2192extern char *get_task_comm(char *to, struct task_struct *tsk); 2193extern char *get_task_comm(char *to, struct task_struct *tsk);
2193 2194
2194#ifdef CONFIG_SMP 2195#ifdef CONFIG_SMP
2195static inline void scheduler_ipi(void) { } 2196void scheduler_ipi(void);
2196extern unsigned long wait_task_inactive(struct task_struct *, long match_state); 2197extern unsigned long wait_task_inactive(struct task_struct *, long match_state);
2197#else 2198#else
2198static inline void scheduler_ipi(void) { } 2199static inline void scheduler_ipi(void) { }