Re: [PATCH v8 -tip 06/26] sched: Add core wide task selection and scheduling.
From: Joel Fernandes
Date: Tue Oct 27 2020 - 12:58:11 EST
On Mon, Oct 26, 2020 at 09:28:14AM +0100, Peter Zijlstra wrote:
> On Fri, Oct 23, 2020 at 05:31:18PM -0400, Joel Fernandes wrote:
> > BTW, as further optimization in the future, isn't it better for the
> > schedule() loop on 1 HT to select for all HT *even if* need_sync == false to
> > begin with? i.e. no cookied tasks are runnable.
> >
> > That way the pick loop in schedule() running on other HTs can directly pick
> > what was pre-selected for it via:
> > if (rq->core->core_pick_seq == rq->core->core_task_seq &&
> > rq->core->core_pick_seq != rq->core_sched_seq &&
> > rq->core_pick)
> > .. which I think is more efficient. Its just a thought and may not be worth doing.
>
> I'm not sure that works. Imagine a sibling doing a wakeup (or sleep)
> just after you done your core wide pick. Then it will have to repick and
> you end up with having to do 2*nr_smt picks instead of 2 picks.
For a workload that is having mostly runnable tasks (not doing lot of wakeup
/ sleep), maybe it makes sense.
Also if you have only cookied tasks and they are doing wake up / sleep, then
you have 2*nr_smt_picks anyway as the core picks constantly get invalidated,
AFAICS.
I guess in the current code, the assumptions are:
1. Most tasks are not cookied task
2. They can wake up and sleep a lot
I guess those are Ok assumptions though, but maybe we could document it.
thanks,
- Joel