sched/core: remove unnecessary unlikely() in push_xx_task
PATCH 1/1 sched/core: remove unnecessary unlikely() in push_xx_task
WARN_ON() already contains an unlikely(), so it's not necessary to use WARN_ON(1).
Signed-off-by Yangtao Li <[email protected]>
--- kernel/sched/deadline.c | 4 +--- kernel/sched/rt.c | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-)
kernel/sched/deadline.c +1 -3
@@ -2041,10 +2041,8 @@ static int push_dl_task(struct rq *rq)return 0 ; retry: -if (unlikely (next_task == rq->curr)) { -WARN_ON (1 ); +if (WARN_ON (next_task == rq->curr))return 0 ; - }/* * If next_task preempts rq->curr, and rq->curr
kernel/sched/rt.c +1 -3
@@ -1810,10 +1810,8 @@ static int push_rt_task(struct rq *rq)return 0 ; retry: -if (unlikely (next_task == rq->curr)) { -WARN_ON (1 ); +if (WARN_ON (next_task == rq->curr))return 0 ; - }/* * It's possible that the next_task slipped in of
Signature · 1 line
2.17.0
Hi mingo:
What is your point of view?
--Yangtao
Quoted 45 lines · Yangtao Li
WARN_ON()already contains anunlikely(), so it's not necessary to useWARN_ON(1).Signed-off-by Yangtao Li <[email protected]>--- kernel/sched/deadline.c | 4 +--- kernel/sched/rt.c | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-)kernel/sched/deadline.c +1
-3@@ -2041,10 +2041,8 @@ static int push_dl_task(struct rq *rq)return 0 ; retry: -if (unlikely (next_task == rq->curr)) { -WARN_ON (1 ); +if (WARN_ON (next_task == rq->curr))return 0 ; - }/* * If next_task preempts rq->curr, and rq->curr kernel/sched/rt.c +1
-4@@ -1810,10 +1810,8 @@ static int push_rt_task(struct rq *rq)return 0 ; retry: -if (unlikely (next_task == rq->curr)) { -WARN_ON (1 ); +if (WARN_ON (next_task == rq->curr))return 0 ; - }/* * It's possible that the next_task slipped in of -- 2.17.0
tip-bot for Yangtao Li
merge bot[tip:sched/core] sched/core: Remove unnecessary unlikely() in push_*_task()
In reply to Yangtao Lisched/core: Remove unnecessary unlikely() in push_*_task()
Commit-ID: 9ebc6053814d37b9de8cc291fba28f30a729c929 Gitweb: https://git.kernel.org/tip/9ebc6053814d37b9de8cc291fba28f30a729c929 Author: Yangtao Li <[email protected]> AuthorDate: Sat, 3 Nov 2018 13:26:02 -0400 Committer: Ingo Molnar <[email protected]> CommitDate: Tue, 11 Dec 2018 15:16:57 +0100
sched/core: Remove unnecessary unlikely() in push_*_task()
WARN_ON() already contains an unlikely(), so it's not necessary to use WARN_ON(1).
Signed-off-by Yangtao Li <[email protected]>
Signed-off-by Peter Zijlstra (Intel) <[email protected]>
Cc Linus Torvalds <[email protected]>
Cc Mike Galbraith <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Thomas Gleixner <[email protected]>
Signed-off-by Ingo Molnar <[email protected]>
--- kernel/sched/deadline.c | 4 +--- kernel/sched/rt.c | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-)
kernel/sched/deadline.c +1 -3
@@ -2042,10 +2042,8 @@ static int push_dl_task(struct rq *rq)return 0 ; retry: -if (unlikely (next_task == rq->curr)) { -WARN_ON (1 ); +if (WARN_ON (next_task == rq->curr))return 0 ; - }/* * If next_task preempts rq->curr, and rq->curr
kernel/sched/rt.c +1 -3
@@ -1813,10 +1813,8 @@ static int push_rt_task(struct rq *rq)return 0 ; retry: -if (unlikely (next_task == rq->curr)) { -WARN_ON (1 ); +if (WARN_ON (next_task == rq->curr))return 0 ; - }/* * It's possible that the next_task slipped in of