Skip to contentSkip to conversation

sched: Remove unlikely likelys (take two)

GIT PULL Steven Rostedt 2 participants 2 messages Jun 2, 2011 – Jun 3, 2011

lore
Share & tools
lore
#0 lore raw

Hi Ingo,

I noticed this pull request never made it into tip:

https://lkml.org/lkml/2010/12/13/625

I tested it again by merging it into latest Linus's tree and running a bunch of tests on it. The tests show that it still works (besides the bugs it finds from the normal 3.0-rc release).

Please pull the latest unlikely/sched tree, which can be found at:

git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace.git
unlikely/sched

Steven Rostedt (3):
sched: Change pick_next_task_rt from unlikely to likely
sched: Remove unlikely() from rt_policy() in sched.c
sched: Remove unlikely() from ttwu_post_activation

Yong Zhang (1):
sched: Cleanup pre_schedule_rt

----

 kernel/sched.c    |    4 ++--
 kernel/sched_rt.c |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
kernel/sched.c +2 -2
index dc91a4d..6d24b2e 100644
@@ -123,7 +123,7 @@
 
 static inline int rt_policy(int policy)
 {
-	if (unlikely(policy == SCHED_FIFO || policy == SCHED_RR))
+	if (policy == SCHED_FIFO || policy == SCHED_RR)
 		return 1;
 	return 0;
 }
@@ -2458,7 +2458,7 @@ static inline void ttwu_post_activation(struct task_struct *p, struct rq *rq,
 	if (p->sched_class->task_woken)
 		p->sched_class->task_woken(rq, p);
 
-	if (unlikely(rq->idle_stamp)) {
+	if (rq->idle_stamp) {
 		u64 delta = rq->clock - rq->idle_stamp;
 		u64 max = 2*sysctl_sched_migration_cost;
 
kernel/sched_rt.c +2 -2
index bea7d79..c2266c4 100644
@@ -1062,7 +1062,7 @@ static struct task_struct *_pick_next_task_rt(struct rq *rq)
 
 	rt_rq = &rq->rt;
 
-	if (unlikely(!rt_rq->rt_nr_running))
+	if (!rt_rq->rt_nr_running)
 		return NULL;
 
 	if (rt_rq_throttled(rt_rq))
@@ -1474,7 +1474,7 @@ skip:
 static void pre_schedule_rt(struct rq *rq, struct task_struct *prev)
 {
 	/* Try to pull RT tasks here if we lower this rq's prio */
-	if (unlikely(rt_task(prev)) && rq->rt.highest_prio.curr > prev->prio)
+	if (rq->rt.highest_prio.curr > prev->prio)
 		pull_rt_task(rq);
 }
 
#1 lore raw
Quoted 21 lines · Steven Rostedt

Hi Ingo,

I noticed this pull request never made it into tip:

https://lkml.org/lkml/2010/12/13/625

I tested it again by merging it into latest Linus's tree and running a bunch of tests on it. The tests show that it still works (besides the bugs it finds from the normal 3.0-rc release).

Please pull the latest unlikely/sched tree, which can be found at:

git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace.git
unlikely/sched

Steven Rostedt (3):
sched: Change pick_next_task_rt from unlikely to likely
sched: Remove unlikely() from rt_policy() in sched.c
sched: Remove unlikely() from ttwu_post_activation

Quoted 7 lines

Yong Zhang (1):
sched: Cleanup pre_schedule_rt

----

 kernel/sched.c    |    4 ++--
 kernel/sched_rt.c |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

Pulled, thanks a lot Steve!

Ingo