1. 14 Dec, 2010 2 commits
    • Steven Rostedt's avatar
      sched: Remove unlikely() from rt_policy() in sched.c · 63f01241
      Steven Rostedt authored
      The rt_policy() has an unlikely() that the policy it is checking is
      of RT priority (SCHED_FIFO or SCHED_RR).
      
      According to the annotate branch profiler it is incorrect most of the time:
      
       correct incorrect  %        Function                  File              Line
       ------- ---------  -        --------                  ----              ----
         36667   654674  94 rt_policy                      sched.c              126
      
      This makes sense because the rt_policy() is used by the sched_set_scheduler()
      and nice(). Although users may use sys_nice a bit, all RT users use
      the sched_set_scheduler() to set their RT priority, including kernel
      threads.
      
      The above numbers were from a normal desktop computer running
      firefox, evolution, xchat and was part of a distcc compile farm.
      
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      63f01241
    • Steven Rostedt's avatar
      sched: Change pick_next_task_rt from unlikely to likely · 8e54a2c0
      Steven Rostedt authored
      The if (unlikely(!rt_rq->rt_nr_running)) test in pick_next_task_rt()
      tests if there is another rt task ready to run. If so, then pick it.
      
      In most systems, only one RT task runs at a time most of the time.
      Running the branch unlikely annotator profiler on a system doing average
      work "running firefox, evolution, xchat, distcc builds, etc", it showed the
      following:
      
       correct incorrect  %        Function                  File              Line
       ------- ---------  -        --------                  ----              ----
        324344 135104992  99 _pick_next_task_rt             sched_rt.c           1064
      
      99% of the time the condition is true. When an RT task schedules out,
      it is unlikely that another RT task is waiting to run on that same run queue.
      
      Simply remove the unlikely() condition.
      Acked-by: default avatarGregory Haskins <ghaskins@novell.com>
      Cc:Peter Zijlstra <a.p.zijlstra@chello.nl>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      8e54a2c0
  2. 13 Dec, 2010 1 commit
  3. 08 Dec, 2010 7 commits
  4. 07 Dec, 2010 17 commits
  5. 06 Dec, 2010 12 commits
  6. 05 Dec, 2010 1 commit