1. 14 12月, 2010 4 次提交
    • S
      sched: Remove unlikely() from ttwu_post_activation · e69c6341
      Steven Rostedt 提交于
      The unlikely() used in ttwu_post_activation() tests if the rq->idle_stamp
      is set. But since this is for a wakeup, and wakeups happen when tasks
      block on IO, and blocking tasks on IO may put the system into idle,
      this can actually be a common occurence.
      
      Running the annotated branch profiler on an average desktop running
      firefox, evolution, xchat and distcc, the report shows:
      
       correct incorrect  %        Function             File              Line
       ------- ---------  -        --------             ----              ----
      34884862 146110926  80 ttwu_post_activation      sched.c            2309
      
      80% of the time, this unlikely is incorrect. Best not to assume what the
      result is, and just remove the branch annotation.
      
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      e69c6341
    • S
      sched: Remove unlikely() from rt_policy() in sched.c · 63f01241
      Steven Rostedt 提交于
      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: NSteven Rostedt <rostedt@goodmis.org>
      63f01241
    • S
      sched: Change pick_next_task_rt from unlikely to likely · 8e54a2c0
      Steven Rostedt 提交于
      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: NGregory Haskins <ghaskins@novell.com>
      Cc:Peter Zijlstra <a.p.zijlstra@chello.nl>
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      8e54a2c0
    • Y
      sched: Cleanup pre_schedule_rt · 33c3d6c6
      Yong Zhang 提交于
      Since [commit 9a897c5a:
      sched: RT-balance, replace hooks with pre/post schedule and wakeup methods]
      we must call pre_schedule_rt if prev is rt task.
      So condition rt_task(prev) is always true and the 'unlikely' declaration is
      simply incorrect.
      Signed-off-by: NYong Zhang <yong.zhang0@gmail.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      33c3d6c6
  2. 08 12月, 2010 18 次提交
  3. 07 12月, 2010 12 次提交
  4. 06 12月, 2010 6 次提交