Question about DOUBLE_TICK's role alongside EEVDF

From: Vishal Chourasia
Date: Fri Feb 23 2024 - 06:55:42 EST


Hi,

I hope you're doing well. I've been looking into some recent changes in the
scheduler code and would like to get your perspective on a few things.

I was examining commit 5e963f2bd465 ("sched/fair: Commit to EEVDF"), which
removed the check_preempt_tick method. As a result, the DOUBLE_TICK feature used
within the entity_tick function no longer seems to directly influence scheduling
decisions. I understand that this feature was designed to handle interactions
between periodic ticks and the high-resolution timer (hrtick).

Here's my understanding so far (please correct me if there are any inaccuracies):

DOUBLE_TICK: Enabled periodic ticks to proceed even when an hrtick timer was
active, potentially canceling the hrtick timer in __schedule if active.

Commit 5e963f2bd465: Removed a key decision point where DOUBLE_TICK played a
role, making its current utility questionable.

This brings me to my main question: As we transition towards EEVDF for
calculating preemption points(based on entity lag) and the scheduler manages
resource allocation in quanta, is there a continued need for the hrtick timer?

In the case of multiple processes with different nice values, EEVDF handles
their preemption according to their lag. However, the exact behavior depends on
the values of base_slice_ns and config_hz.

It's possible I don't have all the pieces of the puzzle, so my question might
not make sense. But I wanted to bring forth this point. It would be great to
know your thoughts.

Thank you for your time.

-- vishal.c


diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 533547e3c90a..73e1372d1a0d 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -5510,12 +5510,6 @@ entity_tick(struct cfs_rq *cfs_rq, struct sched_entity
*curr, int queued)
resched_curr(rq_of(cfs_rq));
return;
}
- /*
- * don't let the period tick interfere with the hrtick preemption
- */
- if (!sched_feat(DOUBLE_TICK) &&
- hrtimer_active(&rq_of(cfs_rq)->hrtick_timer))
- return;
#endif
}