[RFC 31/60] cosched: Don't disable idle tick for now

From: Jan H. SchÃnherr
Date: Fri Sep 07 2018 - 17:42:27 EST


Coscheduling relies on the leader to drive preemption of the
group when the time slice is exhausted. This is also the case,
when the leader is idle but the group as a whole is not.
Because of that, we currently cannot disable the idle tick.

Keep the tick enabled in code. This relieves the user from disabling
NOHZ and allows us to gradually improve the situation later.

Signed-off-by: Jan H. SchÃnherr <jschoenh@xxxxxxxxx>
---
kernel/time/tick-sched.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)

diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
index 5b33e2f5c0ed..5e9c2a7d4ea9 100644
--- a/kernel/time/tick-sched.c
+++ b/kernel/time/tick-sched.c
@@ -861,6 +861,20 @@ static void tick_nohz_full_update_tick(struct tick_sched *ts)

static bool can_stop_idle_tick(int cpu, struct tick_sched *ts)
{
+#ifdef CONFIG_COSCHEDULING
+ /*
+ * FIXME: Coscheduling relies on the leader to drive preemption of the
+ * group when the time slice is exhausted. This is also the case,
+ * when the leader is idle but the group as a whole is not.
+ * Because of that, we currently cannot disable the idle tick.
+ *
+ * Short-term, we could disable the idle tick, in cases where the
+ * whole group is idle. Long-term, we can consider switching
+ * leadership of the group to a non-idle CPU.
+ */
+ return false;
+#endif
+
/*
* If this CPU is offline and it is the one which updates
* jiffies, then give up the assignment and let it be taken by
--
2.9.3.1.gcba166c.dirty