[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20230429002831.2875-1-zeming@nfschina.com>
Date: Sat, 29 Apr 2023 08:28:31 +0800
From: Li zeming <zeming@...china.com>
To: mingo@...hat.com, peterz@...radead.org, juri.lelli@...hat.com,
vincent.guittot@...aro.org, dietmar.eggemann@....com,
rostedt@...dmis.org, bsegall@...gle.com, mgorman@...e.de,
bristot@...hat.com, vschneid@...hat.com
Cc: linux-kernel@...r.kernel.org, Li zeming <zeming@...china.com>
Subject: [PATCH] sched: core: Simplify sched_can_stop_tick()
Remove useless intermediate variable "fifo_nr_running".
Signed-off-by: Li zeming <zeming@...china.com>
---
kernel/sched/core.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 3249c1272e57..1bab401920e8 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -1176,8 +1176,6 @@ static void nohz_csd_func(void *info)
#ifdef CONFIG_NO_HZ_FULL
bool sched_can_stop_tick(struct rq *rq)
{
- int fifo_nr_running;
-
/* Deadline tasks, even if single, need the tick */
if (rq->dl.dl_nr_running)
return false;
@@ -1197,8 +1195,7 @@ bool sched_can_stop_tick(struct rq *rq)
* If there's no RR tasks, but FIFO tasks, we can skip the tick, no
* forced preemption between FIFO tasks.
*/
- fifo_nr_running = rq->rt.rt_nr_running - rq->rt.rr_nr_running;
- if (fifo_nr_running)
+ if (rq->rt.rt_nr_running - rq->rt.rr_nr_running)
return true;
/*
--
2.18.2
Powered by blists - more mailing lists