All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sched: remove branch hints within context_switch()
@ 2010-09-16 12:42 Heiko Carstens
  2010-09-16 14:44 ` [tip:sched/core] sched: Remove " tip-bot for Heiko Carstens
  0 siblings, 1 reply; 2+ messages in thread
From: Heiko Carstens @ 2010-09-16 12:42 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: Tim Blechmann, Peter Zijlstra, Mike Galbraith, linux-kernel

From: Heiko Carstens <heiko.carstens@de.ibm.com>

With 710390d9 "sched: Optimize branch hint in context_switch()" the branch
hint logic within context_switch() got inversed.
In fact the hints "if (likely(!mm))" and "if (likely(!prev->mm))" mean that
it is likely that the previous and next task are kernel threads.
That assumption is certainly counter intuitive, but Tim has shown that at
least with his workload this is true.
Nevertheless the truth is: it depends on the current workload.
So just remove the annotations which also improves readability.

Cc: Tim Blechmann <tim@klingt.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Mike Galbraith <efault@gmx.de>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
---
 kernel/sched.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/sched.c b/kernel/sched.c
index ed09d4f..247a0af 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -2852,14 +2852,14 @@ context_switch(struct rq *rq, struct task_struct *prev,
 	 */
 	arch_start_context_switch(prev);
 
-	if (likely(!mm)) {
+	if (!mm) {
 		next->active_mm = oldmm;
 		atomic_inc(&oldmm->mm_count);
 		enter_lazy_tlb(oldmm, next);
 	} else
 		switch_mm(oldmm, mm, next);
 
-	if (likely(!prev->mm)) {
+	if (!prev->mm) {
 		prev->active_mm = NULL;
 		rq->prev_mm = oldmm;
 	}

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-09-16 14:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-16 12:42 [PATCH] sched: remove branch hints within context_switch() Heiko Carstens
2010-09-16 14:44 ` [tip:sched/core] sched: Remove " tip-bot for Heiko Carstens

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.