Re: [RFC PATCH v7 09/23] sched/fair: Fix forced idle sibling starvation corner case

From: Vineeth Pillai
Date: Fri Aug 28 2020 - 19:24:12 EST




On 8/28/20 5:25 PM, Peter Zijlstra wrote:
The only pupose of this loop seem to be to find if we have a forceidle;
surely we can avoid that by storing this during the pick.
The idea was to kick each cpu that was force idle. But now, thinking
about it, we just need to kick one as it will pick for all the siblings.
Will optimize this as you suggested.


static void task_tick_core(struct rq *rq)
{
if (sched_core_enabled(rq))
resched_forceidle_sibling(rq, &rq->curr->se);
}

#else

static void task_tick_core(struct rq *rq) { }

+#endif
+
/*
* scheduler tick hitting a task of our scheduling class.
*
@@ -10654,6 +10688,11 @@ static void task_tick_fair(struct rq *rq, struct task_struct *curr, int queued)
update_misfit_status(curr, rq);
update_overutilized_status(task_rq(curr));
+
+#ifdef CONFIG_SCHED_CORE
+ if (sched_core_enabled(rq))
+ resched_forceidle_sibling(rq, &curr->se);
+#endif
Then you can ditch the #ifdef here
Makes sense, will do.

Thanks,
Vineeth