From a3a1de0c34de6f5f8332cd6151c46af7813c0fcb Mon Sep 17 00:00:00 2001 From: Tim Blechmann Date: Tue, 24 Nov 2009 11:55:15 +0100 Subject: [PATCH] sched, x86: Optimize branch hint in __switch_to() Branch hint profiling on my nehalem machine showed 96% incorrect branch hints: 6548732 174664120 96 __switch_to process_64.c 406 6548745 174565593 96 __switch_to process_64.c 410 Signed-off-by: Tim Blechmann Cc: Peter Zijlstra Cc: Mike Galbraith Cc: Paul Mackerras Cc: Arnaldo Carvalho de Melo Cc: Frederic Weisbecker LKML-Reference: <4B0BBB93.3080307@klingt.org> Signed-off-by: Ingo Molnar --- arch/x86/kernel/process_64.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c index ad535b683170..d9db1049e86f 100644 --- a/arch/x86/kernel/process_64.c +++ b/arch/x86/kernel/process_64.c @@ -406,11 +406,10 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p) * This won't pick up thread selector changes, but I guess that is ok. */ savesegment(es, prev->es); - if (unlikely(next->es | prev->es)) + if (next->es | prev->es) loadsegment(es, next->es); - savesegment(ds, prev->ds); - if (unlikely(next->ds | prev->ds)) + if (next->ds | prev->ds) loadsegment(ds, next->ds); -- 2.20.1