Skip to content
Snippets Groups Projects
Commit a3a1de0c authored by Tim Blechmann's avatar Tim Blechmann Committed by Ingo Molnar
Browse files

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: default avatarTim Blechmann <tim@klingt.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
LKML-Reference: <4B0BBB93.3080307@klingt.org>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 710390d9
No related branches found
No related tags found
No related merge requests found
...@@ -406,11 +406,10 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p) ...@@ -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. * This won't pick up thread selector changes, but I guess that is ok.
*/ */
savesegment(es, prev->es); savesegment(es, prev->es);
if (unlikely(next->es | prev->es)) if (next->es | prev->es)
loadsegment(es, next->es); loadsegment(es, next->es);
savesegment(ds, prev->ds); savesegment(ds, prev->ds);
if (unlikely(next->ds | prev->ds)) if (next->ds | prev->ds)
loadsegment(ds, next->ds); loadsegment(ds, next->ds);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment