Skip to contentSkip to conversation

sched: core: Simplify sched_can_stop_tick()

PATCH New Li zeming 1 participant 1 message Apr 27, 2023 Scheduler

lore
Share & tools
lore

Li zeming

author
#0 lore raw

PATCH 1/1 sched: core: Simplify sched_can_stop_tick()

Remove useless intermediate variable "fifo_nr_running".

---
 kernel/sched/core.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
kernel/sched/core.c +1 -4
index 3249c1272e57..1bab401920e8 100644
@@ -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;
 
 	/*
Signature · 1 line
2.18.2